summaryrefslogtreecommitdiffstats
path: root/core/command
diff options
context:
space:
mode:
Diffstat (limited to 'core/command')
-rw-r--r--core/command/config/system/getconfig.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/core/command/config/system/getconfig.php b/core/command/config/system/getconfig.php
index 80b41a68526..b76474112a0 100644
--- a/core/command/config/system/getconfig.php
+++ b/core/command/config/system/getconfig.php
@@ -48,8 +48,8 @@ class GetConfig extends Base {
->setDescription('Get a system config value')
->addArgument(
'name',
- InputArgument::REQUIRED,
- 'Name of the config to get'
+ InputArgument::REQUIRED | InputArgument::IS_ARRAY,
+ 'Name of the config to get, specify multiple for array parameter'
)
->addOption(
'default-value',
@@ -68,7 +68,8 @@ class GetConfig extends Base {
* @return null|int null or 0 if everything went fine, or an error code
*/
protected function execute(InputInterface $input, OutputInterface $output) {
- $configName = $input->getArgument('name');
+ $configNames = $input->getArgument('name');
+ $configName = array_shift($configNames);
$defaultValue = $input->getOption('default-value');
if (!in_array($configName, $this->systemConfig->getKeys()) && !$input->hasParameterOption('--default-value')) {
@@ -79,6 +80,18 @@ class GetConfig extends Base {
$configValue = $defaultValue;
} else {
$configValue = $this->systemConfig->getValue($configName);
+ if (!empty($configNames)) {
+ foreach ($configNames as $configName) {
+ if (isset($configValue[$configName])) {
+ $configValue = $configValue[$configName];
+ } else if (!$input->hasParameterOption('--default-value')) {
+ return 1;
+ } else {
+ $configValue = $defaultValue;
+ break;
+ }
+ }
+ }
}
$this->writeMixedInOutputFormat($input, $output, $configValue);