本文整理汇总了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');
}
}
示例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;
}
示例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;
}
示例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');
}
}