當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。