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


PHP Application::registerDeferredProvider方法代码示例

本文整理汇总了PHP中Illuminate\Contracts\Foundation\Application::registerDeferredProvider方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::registerDeferredProvider方法的具体用法?PHP Application::registerDeferredProvider怎么用?PHP Application::registerDeferredProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Contracts\Foundation\Application的用法示例。


在下文中一共展示了Application::registerDeferredProvider方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: launchServices

 private function launchServices(array $services)
 {
     foreach ($services as $service) {
         $this->loaded[] = $service;
         $this->application->registerDeferredProvider($service);
     }
     return $this;
 }
开发者ID:laravel-commode,项目名称:silent-service,代码行数:8,代码来源:SilentManager.php

示例2: register

 /**
  * Registers the server in the container.
  *
  * @return \Illuminate\Foundation\Application
  * @throws \Exception
  */
 public function register()
 {
     // Auto register the support service provider
     if (!get_class($this) == SupportServiceProvider::class) {
         $this->app->register(SupportServiceProvider::class);
     }
     $this->viewsPath = Str::replace($this->viewsPath, '{resourcesPath}', $this->getResourcesPath());
     $this->assetsPath = Str::replace($this->assetsPath, '{resourcesPath}', $this->getResourcesPath());
     $router = $this->app->make('router');
     $kernel = $this->app->make('Illuminate\\Contracts\\Http\\Kernel');
     $this->registerConfigFiles();
     foreach ($this->prependMiddleware as $middleware) {
         $kernel->prependMiddleware($middleware);
     }
     foreach ($this->middleware as $middleware) {
         $kernel->pushMiddleware($middleware);
     }
     foreach ($this->routeMiddleware as $key => $middleware) {
         $router->middleware($key, $middleware);
     }
     foreach ($this->providers as $provider) {
         $this->app->register($provider);
     }
     foreach ($this->deferredProviders as $provider) {
         $this->app->registerDeferredProvider($provider);
     }
     foreach ($this->bindings as $binding => $class) {
         $this->app->bind($binding, $class);
     }
     foreach ($this->singletons as $binding => $class) {
         if ($this->strict && !class_exists($class) && !interface_exists($class)) {
             throw new \Exception(get_called_class() . ": Could not find alias class [{$class}]. This exception is only thrown when \$strict checking is enabled");
         }
         $this->app->singleton($binding, $class);
     }
     foreach ($this->aliases as $alias => $full) {
         if ($this->strict && !class_exists($full) && !interface_exists($full)) {
             throw new \Exception(get_called_class() . ": Could not find alias class [{$full}]. This exception is only thrown when \$strict checking is enabled");
         }
         $this->app->alias($alias, $full);
     }
     if (is_array($this->commands) and count($this->commands) > 0) {
         $this->commands($this->commands);
     }
     AliasLoader::getInstance($this->facades)->register();
     $this->requireHelpersFor('register');
     return $this->app;
 }
开发者ID:docit,项目名称:support,代码行数:54,代码来源:ServiceProvider.php


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