aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-05-08 17:39:47 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-05-12 11:27:47 +0000
commitda08aee2cb685337337b6f796e13bacff27aa916 (patch)
tree02f3446e37cd6d4e24b447d938275ea3be23ed52
parentbb720fc6faa5c59674196c2366a5098b007d00dd (diff)
downloadnextcloud-server-backport/52693/stable30.tar.gz
nextcloud-server-backport/52693/stable30.zip
feat: allow setting system config values with json valuebackport/52693/stable30
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--core/Command/Config/System/SetConfig.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/Command/Config/System/SetConfig.php b/core/Command/Config/System/SetConfig.php
index 693bc9bb12b..4ea33836956 100644
--- a/core/Command/Config/System/SetConfig.php
+++ b/core/Command/Config/System/SetConfig.php
@@ -142,6 +142,13 @@ class SetConfig extends Base {
'readable-value' => ($value === '') ? 'empty string' : 'string ' . $value,
];
+ case 'json':
+ $value = json_decode($value, true);
+ return [
+ 'value' => $value,
+ 'readable-value' => 'json ' . json_encode($value),
+ ];
+
default:
throw new \InvalidArgumentException('Invalid type');
}
@@ -183,7 +190,7 @@ class SetConfig extends Base {
*/
public function completeOptionValues($optionName, CompletionContext $context) {
if ($optionName === 'type') {
- return ['string', 'integer', 'double', 'boolean'];
+ return ['string', 'integer', 'double', 'boolean', 'json', 'null'];
}
return parent::completeOptionValues($optionName, $context);
}