Fix config listing
parent
75da832cd3
commit
ef68125b3b
|
@ -267,12 +267,13 @@ EOT
|
||||||
*/
|
*/
|
||||||
protected function listConfiguration(array $contents, OutputInterface $output, $k = null)
|
protected function listConfiguration(array $contents, OutputInterface $output, $k = null)
|
||||||
{
|
{
|
||||||
|
$origK = $k;
|
||||||
foreach ($contents as $key => $value) {
|
foreach ($contents as $key => $value) {
|
||||||
if ($k === null && !in_array($key, array('config', 'repositories'))) {
|
if ($k === null && !in_array($key, array('config', 'repositories'))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($value)) {
|
if (is_array($value) && !is_numeric(key($value))) {
|
||||||
$k .= preg_replace('{^config\.}', '', $key . '.');
|
$k .= preg_replace('{^config\.}', '', $key . '.');
|
||||||
$this->listConfiguration($value, $output, $k);
|
$this->listConfiguration($value, $output, $k);
|
||||||
|
|
||||||
|
@ -280,12 +281,16 @@ EOT
|
||||||
$k = str_split($k, strrpos($k, '.', -2));
|
$k = str_split($k, strrpos($k, '.', -2));
|
||||||
$k = $k[0] . '.';
|
$k = $k[0] . '.';
|
||||||
} else {
|
} else {
|
||||||
$k = null;
|
$k = $origK;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_array($value)) {
|
||||||
|
$value = '['.implode(', ', $value).']';
|
||||||
|
}
|
||||||
|
|
||||||
$output->writeln('[<comment>' . $k . $key . '</comment>] <info>' . $value . '</info>');
|
$output->writeln('[<comment>' . $k . $key . '</comment>] <info>' . $value . '</info>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue