当前位置: 首页>>代码示例>>PHP>>正文


PHP ServiceProvider::__construct方法代码示例

本文整理汇总了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);
 }
开发者ID:loduis,项目名称:artisan,代码行数:12,代码来源:Console.php

示例2: __construct

 public function __construct($app)
 {
     parent::__construct($app);
     $this->houseModel = new House();
     $this->projectModel = new Project();
     $this->designModel = new Design();
 }
开发者ID:khanhpnk,项目名称:sbds,代码行数:7,代码来源:ViewComposerServiceProvider.php

示例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);
 }
开发者ID:kamilmiesiac,项目名称:microweber,代码行数:7,代码来源:MicroweberServiceProvider.php

示例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]);
     });
 }
开发者ID:laravelflare,项目名称:flare,代码行数:12,代码来源:FlareServiceProvider.php

示例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.');
     }
 }
开发者ID:MarkVaughn,项目名称:illuminated,代码行数:14,代码来源:ServiceProvider.php

示例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();
 }
开发者ID:munza,项目名称:locality,代码行数:13,代码来源:LocalityServiceProvider.php

示例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']);
 }
开发者ID:arcanedev,项目名称:workbench,代码行数:14,代码来源:Module.php

示例8: __construct

 public function __construct(Application $app, Router $router, View $view)
 {
     parent::__construct($app);
     $this->app = $app;
     $this->router = $router;
     $this->view = $view;
 }
开发者ID:PhonemeCms,项目名称:cms,代码行数:7,代码来源:CommentsServiceProvider.php

示例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;
 }
开发者ID:elfsundae,项目名称:laravel-bearychat,代码行数:13,代码来源:ServiceProvider.php

示例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);
 }
开发者ID:stalinko,项目名称:laravel-mpay24,代码行数:8,代码来源:LaravelMPay24ServiceProvider.php

示例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);
         });
     }
 }
开发者ID:mvalim,项目名称:package-utils,代码行数:9,代码来源:Provider.php

示例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);
 }
开发者ID:rtler,项目名称:laravel-oauth2-server,代码行数:10,代码来源:Oauth2ServiceProvider.php

示例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));
     }
 }
开发者ID:netforcews,项目名称:framework,代码行数:16,代码来源:ServiceProvider.php

示例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']);
     }
 }
开发者ID:marcmascarell,项目名称:laravel-artificer,代码行数:11,代码来源:ResourceInstaller.php

示例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;
         }
     }
 }
开发者ID:sellerlabs,项目名称:beakers,代码行数:37,代码来源:GenericServiceProvider.php


注:本文中的Illuminate\Support\ServiceProvider::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。