aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
Diffstat (limited to 'core/Command')
-rw-r--r--core/Command/Base.php2
-rw-r--r--core/Command/Config/App/GetConfig.php12
-rw-r--r--core/Command/Config/App/SetConfig.php5
-rw-r--r--core/Command/Config/ListConfigs.php2
-rw-r--r--core/Command/Config/Preset.php2
5 files changed, 21 insertions, 2 deletions
diff --git a/core/Command/Base.php b/core/Command/Base.php
index c9b6337b64a..6ab2765b0f9 100644
--- a/core/Command/Base.php
+++ b/core/Command/Base.php
@@ -170,6 +170,8 @@ class Base extends Command implements CompletionAwareInterface {
return 'true';
} elseif ($value === null) {
return $returnNull ? null : 'null';
+ } if ($value instanceof \UnitEnum) {
+ return $value->value;
} else {
return $value;
}
diff --git a/core/Command/Config/App/GetConfig.php b/core/Command/Config/App/GetConfig.php
index b68476a2e91..af0c5648232 100644
--- a/core/Command/Config/App/GetConfig.php
+++ b/core/Command/Config/App/GetConfig.php
@@ -38,6 +38,12 @@ class GetConfig extends Base {
'returns complete details about the app config value'
)
->addOption(
+ '--key-details',
+ null,
+ InputOption::VALUE_NONE,
+ 'returns complete details about the app config key'
+ )
+ ->addOption(
'default-value',
null,
InputOption::VALUE_OPTIONAL,
@@ -66,6 +72,12 @@ class GetConfig extends Base {
return 0;
}
+ if ($input->getOption('key-details')) {
+ $details = $this->appConfig->getKeyDetails($appName, $configName);
+ $this->writeArrayInOutputFormat($input, $output, $details);
+ return 0;
+ }
+
try {
$configValue = $this->appConfig->getDetails($appName, $configName)['value'];
} catch (AppConfigUnknownKeyException $e) {
diff --git a/core/Command/Config/App/SetConfig.php b/core/Command/Config/App/SetConfig.php
index 1f4ab81bf05..c818404fc0e 100644
--- a/core/Command/Config/App/SetConfig.php
+++ b/core/Command/Config/App/SetConfig.php
@@ -199,6 +199,11 @@ class SetConfig extends Base {
$current['lazy'] ? 'lazy cache' : 'fast cache'
)
);
+ $keyDetails = $this->appConfig->getKeyDetails($appName, $configName);
+ if (($keyDetails['note'] ?? '') !== '') {
+ $output->writeln('<comment>Note:</comment> ' . $keyDetails['note']);
+ }
+
} else {
$output->writeln('<info>Config value were not updated</info>');
}
diff --git a/core/Command/Config/ListConfigs.php b/core/Command/Config/ListConfigs.php
index b81bfbf4d18..a7c195276eb 100644
--- a/core/Command/Config/ListConfigs.php
+++ b/core/Command/Config/ListConfigs.php
@@ -125,7 +125,7 @@ class ListConfigs extends Base {
*/
protected function getAppConfigs(string $app, bool $noSensitiveValues) {
if ($noSensitiveValues) {
- return $this->appConfig->getFilteredValues($app, false);
+ return $this->appConfig->getFilteredValues($app);
} else {
return $this->appConfig->getValues($app, false);
}
diff --git a/core/Command/Config/Preset.php b/core/Command/Config/Preset.php
index 9f1424dcc54..4f0278896db 100644
--- a/core/Command/Config/Preset.php
+++ b/core/Command/Config/Preset.php
@@ -8,9 +8,9 @@ declare(strict_types=1);
*/
namespace OC\Core\Command\Config;
-use NCU\Config\Lexicon\Preset as ConfigLexiconPreset;
use OC\Config\ConfigManager;
use OC\Core\Command\Base;
+use OCP\Config\Lexicon\Preset as ConfigLexiconPreset;
use OCP\IConfig;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;