X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FRelocate.php;h=a6fdd8bfbd1304a0ecff34e1656236fd04b6334e;hb=9581b05603e6ee4e250738c159ed2e67b3fb2eeb;hp=8a76c92070777e62c7c1c090008bd9a2a8d4e395;hpb=0f91d1cbde9e36b10d66fe756229ec8a9635f7eb;p=friendica.git diff --git a/src/Console/Relocate.php b/src/Console/Relocate.php index 8a76c92070..a6fdd8bfbd 100644 --- a/src/Console/Relocate.php +++ b/src/Console/Relocate.php @@ -92,18 +92,19 @@ HELP; throw new \InvalidArgumentException('Can not parse new base URL. Must have at least ://'); } - $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 = $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, false); - $this->config->set('system', 'maintenance_reason', 'Relocating node to ' . $new_url, false); - + $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,9 +189,10 @@ HELP; return 1; } finally { $this->out('Leaving maintenance mode'); - $this->config->set('system', 'maintenance', false, false); - $this->config->set('system', 'maintenance_reason', '', false); - $this->config->save(); + $this->config->beginTransaction() + ->set('system', 'maintenance', false) + ->delete('system', 'maintenance_reason') + ->commit(); } // send relocate