<?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
*
$old_host = str_replace('http://', '@', Strings::normaliseLink($old_url));
$this->out('Entering maintenance mode');
- $this->config->set('system', 'maintenance', true);
- $this->config->set('system', 'maintenance_reason', 'Relocating node to ' . $new_url);
-
+ $this->config->beginTransaction()
+ ->set('system', 'maintenance', true)
+ ->set('system', 'maintenance_reason', 'Relocating node to ' . $new_url)
+ ->commit();
try {
if (!$this->database->transaction()) {
throw new \Exception('Unable to start a transaction, please retry later.');
return 1;
} finally {
$this->out('Leaving maintenance mode');
- $this->config->set('system', 'maintenance', false);
- $this->config->set('system', 'maintenance_reason', '');
+ $this->config->beginTransaction()
+ ->set('system', 'maintenance', false)
+ ->delete('system', 'maintenance_reason')
+ ->commit();
}
// send relocate