X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FMaintenance.php;h=076b89db828279fc8bc7d0b7c97370b5af777747;hb=9581b05603e6ee4e250738c159ed2e67b3fb2eeb;hp=e9909ed0572c9bc9f32398da5d17954a3cfb29bf;hpb=10f8631cd9423629d5189ae71d82964e4db18892;p=friendica.git diff --git a/src/Console/Maintenance.php b/src/Console/Maintenance.php index e9909ed057..076b89db82 100644 --- a/src/Console/Maintenance.php +++ b/src/Console/Maintenance.php @@ -1,6 +1,6 @@ appMode = $appMode; - $this->config = $keyValue; + $this->config = $config; } protected function doExecute(): int @@ -100,16 +100,20 @@ HELP; $enabled = intval($this->getArgument(0)); - $this->config->set('system', 'maintenance', $enabled); + $transactionConfig = $this->config->beginTransaction(); + + $transactionConfig->set('system', 'maintenance', $enabled); $reason = $this->getArgument(1); if ($enabled && $this->getArgument(1)) { - $this->config->set('system', 'maintenance_reason', $this->getArgument(1)); + $transactionConfig->set('system', 'maintenance_reason', $this->getArgument(1)); } else { - $this->config->set('system', 'maintenance_reason', ''); + $transactionConfig->delete('system', 'maintenance_reason'); } + $transactionConfig->commit(); + if ($enabled) { $mode_str = "maintenance mode"; } else {