From: Philipp Holzer Date: Sat, 4 May 2019 14:22:47 +0000 (+0200) Subject: Rename ServiceUnavailableException & alter maintenance X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9fb111bca2cc7ab0817d4ddcb294faa9c144c650;p=friendica.git Rename ServiceUnavailableException & alter maintenance --- diff --git a/src/App.php b/src/App.php index 32e9fa8763..0f0c0537e4 100644 --- a/src/App.php +++ b/src/App.php @@ -988,7 +988,7 @@ class App header('Refresh: 120; url=' . $this->getBaseURL() . "/" . $this->query_string); Module\Special\HTTPException::rawContent( - new HTTPException\ServiceUnavaiableException('The node is currently overloaded. Please try again later.') + new HTTPException\ServiceUnavailableException('The node is currently overloaded. Please try again later.') ); } diff --git a/src/Module/Maintenance.php b/src/Module/Maintenance.php index e7dc5a075d..24140bb351 100644 --- a/src/Module/Maintenance.php +++ b/src/Module/Maintenance.php @@ -4,8 +4,8 @@ namespace Friendica\Module; use Friendica\BaseModule; use Friendica\Core\L10n; -use Friendica\Core\Renderer; use Friendica\Core\System; +use Friendica\Network\HTTPException; use Friendica\Util\Strings; /** @@ -25,13 +25,8 @@ class Maintenance extends BaseModule System::externalRedirect($reason, 307); } - header('HTTP/1.1 503 Service Temporarily Unavailable'); - header('Status: 503 Service Temporarily Unavailable'); - header('Retry-After: 600'); - - return Renderer::replaceMacros(Renderer::getMarkupTemplate('maintenance.tpl'), [ - '$sysdown' => L10n::t('System down for maintenance'), - '$reason' => $reason - ]); + $exception = new HTTPException\ServiceUnavailableException($reason); + $exception->httpdesc = L10n::t('System down for maintenance'); + throw $exception; } } diff --git a/src/Network/HTTPException/ServiceUnavaiableException.php b/src/Network/HTTPException/ServiceUnavaiableException.php deleted file mode 100644 index 6c0e6595d8..0000000000 --- a/src/Network/HTTPException/ServiceUnavaiableException.php +++ /dev/null @@ -1,10 +0,0 @@ -