]> git.mxchange.org Git - friendica.git/commitdiff
Rename ServiceUnavailableException & alter maintenance
authorPhilipp Holzer <admin@philipp.info>
Sat, 4 May 2019 14:22:47 +0000 (16:22 +0200)
committerPhilipp Holzer <admin@philipp.info>
Sun, 5 May 2019 08:07:33 +0000 (10:07 +0200)
src/App.php
src/Module/Maintenance.php
src/Network/HTTPException/ServiceUnavaiableException.php [deleted file]
src/Network/HTTPException/ServiceUnavailableException.php [new file with mode: 0644]

index 32e9fa876300988fc5ae09bc90cad5cce0cf40c7..0f0c0537e4d98ae5538fda12993c2734c49e6d4f 100644 (file)
@@ -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.')
                        );
                }
 
index e7dc5a075d9ff11528d3264c82f3204cc0327e02..24140bb3512e981cdfb6e466e86043357d3d6eb7 100644 (file)
@@ -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 (file)
index 6c0e659..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-namespace Friendica\Network\HTTPException;
-
-use Friendica\Network\HTTPException;
-
-class ServiceUnavaiableException extends HTTPException
-{
-       protected $code = 503;
-}
diff --git a/src/Network/HTTPException/ServiceUnavailableException.php b/src/Network/HTTPException/ServiceUnavailableException.php
new file mode 100644 (file)
index 0000000..257b8c8
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+
+namespace Friendica\Network\HTTPException;
+
+use Friendica\Network\HTTPException;
+
+class ServiceUnavailableException extends HTTPException
+{
+       protected $code = 503;
+}