Introduce ConfigFileManager for config files
This commit is contained in:
@@ -100,16 +100,18 @@ HELP;
|
||||
|
||||
$enabled = intval($this->getArgument(0));
|
||||
|
||||
$this->config->set('system', 'maintenance', $enabled);
|
||||
$this->config->set('system', 'maintenance', $enabled, false);
|
||||
|
||||
$reason = $this->getArgument(1);
|
||||
|
||||
if ($enabled && $this->getArgument(1)) {
|
||||
$this->config->set('system', 'maintenance_reason', $this->getArgument(1));
|
||||
$this->config->set('system', 'maintenance_reason', $this->getArgument(1), false);
|
||||
} else {
|
||||
$this->config->set('system', 'maintenance_reason', '');
|
||||
$this->config->set('system', 'maintenance_reason', '', false);
|
||||
}
|
||||
|
||||
$this->config->save();
|
||||
|
||||
if ($enabled) {
|
||||
$mode_str = "maintenance mode";
|
||||
} else {
|
||||
|
||||
@@ -101,8 +101,8 @@ HELP;
|
||||
$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->set('system', 'maintenance', true, false);
|
||||
$this->config->set('system', 'maintenance_reason', 'Relocating node to ' . $new_url, false);
|
||||
|
||||
try {
|
||||
if (!$this->database->transaction()) {
|
||||
@@ -189,8 +189,9 @@ HELP;
|
||||
return 1;
|
||||
} finally {
|
||||
$this->out('Leaving maintenance mode');
|
||||
$this->config->set('system', 'maintenance', false);
|
||||
$this->config->set('system', 'maintenance_reason', '');
|
||||
$this->config->set('system', 'maintenance', false, false);
|
||||
$this->config->set('system', 'maintenance_reason', '', false);
|
||||
$this->config->save();
|
||||
}
|
||||
|
||||
// send relocate
|
||||
|
||||
Reference in New Issue
Block a user