protected function fire()
{
$name = $this->argument('name');
$file = $this->argument('file');
if ($name) {
if (strpos($name, '.') !== false) {
list($file, $name) = explode('.', $name, 2);
}
if ($file) {
$value = $this->craft->getComponent('config')->get($name, $file);
} else {
$value = $this->craft->getComponent('config')->get($name);
}
$this->line($this->dump($value));
return;
}
$headers = array('File', 'Name', 'Value');
$rows = array();
$configService = $this->craft->getComponent('config');
$reflectionClass = new ReflectionClass($configService);
$reflectionProperty = $reflectionClass->getProperty('_loadedConfigFiles');
$reflectionProperty->setAccessible(true);
$configFiles = $reflectionProperty->getValue($configService);
foreach ($configFiles as $file => $config) {
ksort($config);
foreach ($config as $key => $value) {
$rows[] = array($file, $key, $this->dump($value));
}
}
$this->table($headers, $rows);
}