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


PHP Application::getCachedConfigPath方法代码示例

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


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

示例1: 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

示例2: bootstrap

 /**
  * @param \Illuminate\Contracts\Foundation\Application|\Notadd\Foundation\Application $application
  *
  * @return void
  */
 public function bootstrap(Application $application)
 {
     $items = [];
     if (file_exists($cached = $application->getCachedConfigPath())) {
         $items = (require $cached);
         $loadedFromCache = true;
     }
     $application->instance('config', $config = new Repository($items));
     if (!isset($loadedFromCache)) {
         $this->loadConfigurationFiles($application, $config);
     }
     $application->detectEnvironment(function () use($config) {
         return $config->get('app.env', 'production');
     });
     mb_internal_encoding('UTF-8');
 }
开发者ID:notadd,项目名称:framework,代码行数:21,代码来源:LoadConfiguration.php

示例3: bootstrap

 /**
  * Bootstrap the given application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @return void
  */
 public function bootstrap(Application $app)
 {
     $items = [];
     // First we will see if we have a cache configuration file. If we do, we'll load
     // the configuration items from that file so that it is very quick. Otherwise
     // we will need to spin through every configuration file and load them all.
     if (file_exists($cached = $app->getCachedConfigPath())) {
         $items = (require $cached);
         $loadedFromCache = true;
     }
     $app->instance('config', $config = new Repository($items));
     // Next we will spin through all of the configuration files in the configuration
     // directory and load each one into the repository. This will make all of the
     // options available to the developer for use in various parts of this app.
     if (!isset($loadedFromCache)) {
         $this->loadConfigurationFiles($app, $config);
     }
     date_default_timezone_set($config['app.timezone']);
 }
开发者ID:sergey-kudriavtsev,项目名称:framework-1,代码行数:25,代码来源:LoadConfiguration.php


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