diff options
author | Robin Appelman <robin@icewind.nl> | 2025-05-12 13:18:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-12 13:18:26 +0200 |
commit | 7e9fc7604a891de10b507a8d8f5e6361671eb308 (patch) | |
tree | f7b45a492c6efc623d2cfb76ef7adac4958ef836 | |
parent | 768b101a9d4e371d9fcb5611113f7c23c77ddd81 (diff) | |
parent | ffe10d4916b1c94bb9f5c5cd9028851df3dc1ed9 (diff) | |
download | nextcloud-server-7e9fc7604a891de10b507a8d8f5e6361671eb308.tar.gz nextcloud-server-7e9fc7604a891de10b507a8d8f5e6361671eb308.zip |
Merge pull request #52693 from nextcloud/config-system-set-json
feat: allow setting system config values with json value
-rw-r--r-- | core/Command/Config/System/SetConfig.php | 9 |
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); } |