本文整理汇总了PHP中Illuminate\Support\ServiceProvider::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP ServiceProvider::__construct方法的具体用法?PHP ServiceProvider::__construct怎么用?PHP ServiceProvider::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\ServiceProvider
的用法示例。
在下文中一共展示了ServiceProvider::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Crea a new instance of console
*
* @param string $basePath
*/
public function __construct($basePath)
{
parent::__construct(new Application($basePath));
$this->input = new ArgvInput();
$this->output = new ConsoleOutput();
$this->config = $this->getConfiguration($basePath);
}
示例2: __construct
public function __construct($app)
{
parent::__construct($app);
$this->houseModel = new House();
$this->projectModel = new Project();
$this->designModel = new Design();
}
示例3: __construct
public function __construct($app)
{
ClassLoader::addDirectories(array(base_path() . DIRECTORY_SEPARATOR . 'userfiles' . DIRECTORY_SEPARATOR . 'modules', __DIR__));
ClassLoader::register();
spl_autoload_register(array($this, 'autoloadModules'));
parent::__construct($app);
}
示例4: __construct
/**
* Create a new service provider instance.
*
* @param \Illuminate\Contracts\Foundation\Application $app
*/
public function __construct($app)
{
parent::__construct($app);
$this->app->singleton('flare', function ($app) {
return $app->make(\LaravelFlare\Flare\Flare::class, [$app]);
});
}
示例5: __construct
/**
* Create a new service provider instance.
*
* @param Application $app
*
* @throws LackOfCoffeeException
*/
public function __construct(Application $app)
{
parent::__construct($app);
if ($this->defer === null) {
throw new LackOfCoffeeException('Please define whether this provider should be deferred or not.');
}
}
示例6: __construct
/**
* Service provider constructor method.
*
* @param \Illuminate\Support\Facades\App $app
* @return void
*/
public function __construct($app)
{
parent::__construct($app);
$this->providers = config('locality.providers', []);
$this->aliases = config('locality.aliases', []);
$this->aliasLoader = AliasLoader::getInstance();
}
示例7: __construct
/**
* The constructor.
*
* @param Application $app
* @param string $name
* @param string $path
*/
public function __construct(Application $app, $name, $path)
{
parent::__construct($app);
$this->setName($name);
$this->setPath(realpath($path));
$this->setDispatcher($app['events']);
}
示例8: __construct
public function __construct(Application $app, Router $router, View $view)
{
parent::__construct($app);
$this->app = $app;
$this->router = $router;
$this->view = $view;
}
示例9: __construct
/**
* Create a new service provider instance.
*
* @param \Illuminate\Contracts\Foundation\Application $app
*/
public function __construct($app)
{
parent::__construct($app);
$appVersion = method_exists($app, 'version') ? $app->version() : $app::VERSION;
$this->isLumen = str_contains($appVersion, 'Lumen');
$this->isLaravel4 = (int) $appVersion == 4;
$this->isLaravel5 = (int) $appVersion == 5;
}
示例10: __construct
public function __construct($app)
{
$this->merchantId = config('services.mpay24.merchantId');
$this->password = config('services.mpay24.password');
$this->testMode = config('services.mpay24.test', false);
$this->debugMode = config('services.mpay24.debug', false);
parent::__construct($app);
}
示例11: __construct
public function __construct($app)
{
parent::__construct($app);
if (!$this->app->resolved('Mvalim\\PackageUtils\\Container')) {
$this->app->singleton('Mvalim\\PackageUtils\\Container', function () use($app) {
return new Container($app);
});
}
}
示例12: __construct
public function __construct($app)
{
if (method_exists($app, 'configure')) {
// @codeCoverageIgnoreStart
$app->configure('oauth2');
// @codeCoverageIgnoreEnd
}
$this->options = $app->make('config')->get('oauth2');
parent::__construct($app);
}
示例13: __construct
/**
* Create do provider.
*
* @param \Illuminate\Contracts\Foundation\Application $app
*/
public function __construct($app)
{
parent::__construct($app);
// Trocar instancias
foreach ($this->instances as $provider => $classServiceProvider) {
// Limpar facade
Facade::clearResolvedInstance($provider);
// Trocar / Criar
$this->app->instance($provider, new $classServiceProvider($app));
}
}
示例14: __construct
public function __construct(\Illuminate\Contracts\Foundation\Application $app, $extension)
{
parent::__construct($app);
$this->extension = $extension;
foreach ($this->getCollectedCalls() as $call) {
if ($this->isDefered($call['method'])) {
continue;
}
call_user_func_array([$this, $call['method']], $call['args']);
}
}
示例15: __construct
/**
* Construct a new GenericServiceProvider.
*
* If $provisions and $namespace are set, $namespace should be the the one
* the main service class is located in, and $provisions should consist
* of the names of any services in that directory that need to be bound.
*
* Example:
*
* If we have:
*
* My\Namespaced\ExampleClass
*
* and
*
* My\Namespaced\Interfaces\ExampleClassInterface
*
* then the following assignments would automatically bind the interface
* to the implementation in My\Namespaced\ExampleServiceProvider:
*
* protected $namespace = __NAMESPACE__;
* protected $provisions = ['ExampleClass'];
*
* @param \Illuminate\Foundation\Application $app
*/
public function __construct($app)
{
parent::__construct($app);
if (isset($this->provisions) && isset($this->namespace)) {
foreach ($this->provisions as $provision) {
$baseNamespace = $this->namespace . "\\";
$interface = $baseNamespace . "Interfaces\\" . $provision . "Interface";
$class = $baseNamespace . $provision;
$this->bindings[$interface] = $class;
}
}
}