[UTIL][CONFIG] Ensure setConfig uses a locals key

This commit is contained in:
Hugo Sales 2021-09-06 17:33:46 +01:00
parent 4916c8cbda
commit cbbef90752
Signed by untrusted user: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -92,7 +92,7 @@ abstract class Common
{ {
self::$config[$section][$setting] = $value; self::$config[$section][$setting] = $value;
$diff = self::arrayDiffRecursive(self::$config, self::$defaults); $diff = self::arrayDiffRecursive(self::$config, self::$defaults);
$yaml = (new Yaml\Dumper(indentation: 2))->dump(['parameters' => ['gnusocial' => $diff]], Yaml\Yaml::DUMP_OBJECT_AS_MAP); $yaml = (new Yaml\Dumper(indentation: 2))->dump(['parameters' => ['locals' => ['gnusocial' => $diff]]], Yaml\Yaml::DUMP_OBJECT_AS_MAP);
rename(INSTALLDIR . '/social.local.yaml', INSTALLDIR . '/social.local.yaml.back'); rename(INSTALLDIR . '/social.local.yaml', INSTALLDIR . '/social.local.yaml.back');
file_put_contents(INSTALLDIR . '/social.local.yaml', $yaml); file_put_contents(INSTALLDIR . '/social.local.yaml', $yaml);
} }