From 0457bd995fe4e723a7cad33c8d464186646db5db Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 13 Dec 2017 21:55:19 +0000 Subject: [PATCH] "system_unavailable.php" is unavailable now --- boot.php | 10 ---------- include/dba.php | 2 +- include/system_unavailable.php | 12 ------------ src/Core/System.php | 14 ++++++++++++++ 4 files changed, 15 insertions(+), 23 deletions(-) delete mode 100644 include/system_unavailable.php diff --git a/boot.php b/boot.php index fa26028113..d9a64e570a 100644 --- a/boot.php +++ b/boot.php @@ -563,16 +563,6 @@ function x($s, $k = null) } } -/** - * @brief Called from db initialisation if db is dead. - */ -function system_unavailable() -{ - include 'system_unavailable.php'; - system_down(); - killme(); -} - /** * @brief Returns the baseurl. * diff --git a/include/dba.php b/include/dba.php index fe191a9e21..e08880c605 100644 --- a/include/dba.php +++ b/include/dba.php @@ -97,7 +97,7 @@ class dba { if (!self::$connected) { self::$db = null; if (!$install) { - system_unavailable(); + System::unavailable(); } } $a->save_timestamp($stamp1, "network"); diff --git a/include/system_unavailable.php b/include/system_unavailable.php deleted file mode 100644 index bd7196cdfd..0000000000 --- a/include/system_unavailable.php +++ /dev/null @@ -1,12 +0,0 @@ - -System Unavailable - -Apologies but this site is unavailable at the moment. Please try again later. - - -EOT; -} \ No newline at end of file diff --git a/src/Core/System.php b/src/Core/System.php index 45e4f652af..1c4d863306 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -100,6 +100,20 @@ class System return implode(', ', $callstack2); } + /** + * @brief Called from db initialisation when db is dead. + */ + static public function unavailable() { +echo <<< EOT + + System Unavailable + Apologies but this site is unavailable at the moment. Please try again later. + +EOT; + + killme(); + } + /// @todo Move the following functions from boot.php /* function get_guid($size = 16, $prefix = "")