mirror of
https://github.com/friendica/friendica
synced 2025-04-28 18:24:24 +02:00
Introduce ConfigFileManager for config files
This commit is contained in:
parent
fea4b202c1
commit
0f91d1cbde
21 changed files with 343 additions and 302 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue