]> git.mxchange.org Git - friendica.git/blobdiff - src/Console/Maintenance.php
spelling: unable
[friendica.git] / src / Console / Maintenance.php
index 7744c9ee471d0b56ed07ea4ab25825a20e86fbc9..076b89db828279fc8bc7d0b7c97370b5af777747 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -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 {