X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FRelocate.php;h=22de2903c5b8fe03d7a36b6aee218f2694b4400a;hb=d4a5a8051ad34a7be72238967afb3e6b140afdc8;hp=a90802d81e22f46429c9d53931e66d7fda67d528;hpb=b93f100c9780b77744af99e67f46e04977ce33d2;p=friendica.git diff --git a/src/Console/Relocate.php b/src/Console/Relocate.php index a90802d81e..22de2903c5 100644 --- a/src/Console/Relocate.php +++ b/src/Console/Relocate.php @@ -1,6 +1,6 @@ ://'); } - $this->out(sprintf('Relocation started from %s to %s. Could take a while to complete.', $this->baseUrl->get(true), $this->getArgument(0))); + $this->out(sprintf('Relocation started from %s to %s. Could take a while to complete.', $this->baseUrl, $this->getArgument(0))); - $old_url = $this->baseUrl->get(true); + $old_url = (string)$this->baseUrl; // Generate host names for relocation the addresses in the format user@address.tld $new_host = str_replace('http://', '@', Strings::normaliseLink($new_url)); $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.'); @@ -178,7 +179,6 @@ HELP; // update config $this->out('Updating config values'); $this->config->set('system', 'url', $new_url); - $this->baseUrl->saveByURL($new_url); $this->database->commit(); } catch (\Throwable $e) { @@ -189,8 +189,10 @@ HELP; 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