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:35 +0000
commit7f019e3a14991fae26e358643b733acaee1fd09b (patch)
tree099f7899835da8e0de63b965ebef5f30f2072e53
parent7d69f9cbeb93dbbebf236804b31abe1e36f36497 (diff)
downloadnextcloud-server-backport/52693/stable31.tar.gz
nextcloud-server-backport/52693/stable31.zip
feat: allow setting system config values with json valuebackport/52693/stable31
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 4d23c191ac1..62ab7f7120f 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);
}