當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Application::booted方法代碼示例

本文整理匯總了PHP中Illuminate\Contracts\Foundation\Application::booted方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application::booted方法的具體用法?PHP Application::booted怎麽用?PHP Application::booted使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Contracts\Foundation\Application的用法示例。


在下文中一共展示了Application::booted方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Create a new console kernel instance.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @param  \Illuminate\Contracts\Events\Dispatcher  $events
  * @return void
  */
 public function __construct(Application $app, Dispatcher $events)
 {
     $this->app = $app;
     $this->events = $events;
     $this->app->booted(function () {
         $this->defineConsoleSchedule();
     });
 }
開發者ID:nsoimaru,項目名稱:Laravel51-starter,代碼行數:15,代碼來源:Kernel.php

示例2: __construct

 /**
  * Create a new console kernel instance.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @param  \Illuminate\Contracts\Events\Dispatcher  $events
  * @return void
  */
 public function __construct(Application $app, Dispatcher $events)
 {
     if (!defined('ARTISAN_BINARY')) {
         define('ARTISAN_BINARY', 'artisan');
     }
     $this->app = $app;
     $this->events = $events;
     $this->app->booted(function () {
         $this->defineConsoleSchedule();
     });
 }
開發者ID:qasem2rubik,項目名稱:laravel,代碼行數:18,代碼來源:Kernel.php

示例3: bootstrap

 /**
  * Bootstrap the given application.
  *
  * @param \Illuminate\Contracts\Foundation\Application|\Notadd\Foundation\Application $application
  *
  * @return void
  */
 public function bootstrap(Application $application)
 {
     if ($application->isInstalled()) {
         if ($application->routesAreCached()) {
             $application->booted(function () use($application) {
                 require $application->getCachedRoutesPath();
             });
         } else {
             $application->make('events')->fire(new RouteRegister($application, $application['router']));
             $application->booted(function () use($application) {
                 $application['router']->getRoutes()->refreshNameLookups();
             });
         }
     }
 }
開發者ID:notadd,項目名稱:framework,代碼行數:22,代碼來源:RegisterRouter.php

示例4: bootstrap

 /**
  * Bootstrap the given application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application $app
  * @return void
  */
 public function bootstrap(Application $app)
 {
     /** @var \Illuminate\Foundation\Application $app*/
     $env = $app->environment();
     $filesystem = $this->files = new Filesystem();
     $loader = new FileLoader($filesystem, $app['path.config']);
     $config = new Repository($loader, $filesystem, $env);
     $loader->setRepository($config);
     $app->instance('config', $config);
     $configuredLoader = $app['config']->get('laradic_config.loader');
     if (isset($configuredLoader) && $configuredLoader !== 'file') {
         if ($configuredLoader === 'db') {
             $loader = new DatabaseLoader($filesystem, $app['path.config']);
             $config->setLoader($loader);
             $app->booted(function () use($app, $loader, $config) {
                 $loader->setDatabase($app['db']->connection());
                 $loader->setDatabaseTable($app['config']->get('laradic_config.loaders.db.table'));
             });
             $loader->setRepository($config);
         }
     }
     if (file_exists($cached = $app->getCachedConfigPath()) && !$app->runningInConsole()) {
         $items = (require $cached);
         $loadedFromCache = true;
     }
     if (!isset($loadedFromCache)) {
         # $this->loadConfigurationFiles($app, $config);
     }
     date_default_timezone_set($config['app.timezone']);
     mb_internal_encoding('UTF-8');
 }
開發者ID:laradic,項目名稱:config,代碼行數:37,代碼來源:LoadConfiguration.php


注:本文中的Illuminate\Contracts\Foundation\Application::booted方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。