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


PHP Config::all方法代码示例

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


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

示例1: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $section = $this->argument('section');
     if (!empty($section)) {
         if (!Config::has($section)) {
             $this->error($section . ' does not exist in your configuration.');
             return;
         }
         // If the requested string is a string, and not something that can be displayed in a table, then just print
         // it out in the console.
         $config = Config::get($section);
         if (!is_array($config)) {
             $this->line('<comment>' . $config . '</comment>');
             return;
         }
         $configs = [$section => $config];
     } else {
         $configs = Config::all();
         ksort($configs);
     }
     foreach ($configs as $section => $config) {
         $depth = $this->getConfigDepth($config);
         $tree = $this->generateTree($config, $depth);
         $this->line('<info>Configuration:</info> <comment>' . $section . '</comment>');
         $this->table([], $tree, 'default');
     }
 }
开发者ID:erunion,项目名称:laravel-examine-config,代码行数:32,代码来源:ExamineConfigCommand.php

示例2: resolve

 /**
  * Adds data to the request and returns it
  */
 public function resolve(Request $request)
 {
     $configs = Config::all();
     foreach ($configs['database']['connections'] as $type => $connection) {
         if (!isset($connection['password'])) {
             continue;
         }
         $configs['database']['connections'][$type]['password'] = '**********';
     }
     $configs['app']['key'] = '**********';
     return $configs;
 }
开发者ID:lahaxearnaud,项目名称:clockwork,代码行数:15,代码来源:ConfigDataSource.php

示例3: resolve

 /**
  * Fetch data
  * @return void
  */
 public function resolve()
 {
     $configs = ConfigFacade::all();
     // remove DB password
     foreach ($configs['database']['connections'] as $type => $connection) {
         if (!array_key_exists('password', $connection)) {
             continue;
         }
         $configs['database']['connections'][$type]['password'] = '**********';
     }
     $configs['app']['key'] = '**********';
     $this->data = $configs;
 }
开发者ID:ndrx-io,项目名称:profiler-laravel,代码行数:17,代码来源:Config.php

示例4: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $section = $this->argument('section');
     if (!empty($section)) {
         if (!Config::has($section)) {
             $this->error($section . ' does not exist in your configuration.');
             return;
         }
         $configs = [$section => Config::get($section)];
     } else {
         $configs = Config::all();
         ksort($configs);
     }
     foreach ($configs as $section => $config) {
         $depth = $this->getConfigDepth($config);
         $tree = $this->generateTree($config, $depth);
         $this->line('<info>Configuration:</info> <comment>' . $section . '</comment>');
         $this->table([], $tree, 'default');
     }
 }
开发者ID:brianseitel,项目名称:laravel-examine-config,代码行数:25,代码来源:ExamineConfigCommand.php


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