From: cash Date: Sun, 10 Oct 2010 12:40:02 +0000 (+0000) Subject: handling the database being down/busy or an incomplete install. Also cleaned up fails... X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=e1c54733c388ef0f75d6288c7add7d381e583ac5;p=lorea%2Felgg.git handling the database being down/busy or an incomplete install. Also cleaned up failsafe views git-svn-id: http://code.elgg.org/elgg/trunk@7044 36083f99-b078-4883-b0ff-0f9b5a30f544 --- diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 16e20ef7c..4376ca53f 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1401,9 +1401,10 @@ function __elgg_php_exception_handler($exception) { // make sure the error isn't cached header("Cache-Control: no-cache, must-revalidate", true); header('Expires: Fri, 05 Feb 1982 00:00:00 -0500', true); - // @todo Why don't we send a 500 header? + // @note Do not send a 500 header because it is not a server error //header("Internal Server Error", true, 500); + elgg_set_viewtype('failsafe'); $body = elgg_view("messages/exceptions/exception", array('object' => $exception)); page_draw(elgg_echo('exception:title'), $body); } diff --git a/engine/lib/install.php b/engine/lib/install.php index 9deec9e26..f36b528da 100644 --- a/engine/lib/install.php +++ b/engine/lib/install.php @@ -53,7 +53,6 @@ function verify_installation() { $installed = is_installed(); } catch (DatabaseException $e) {} if (!$installed) { - header("Location: install.php"); - exit; + throw new InstallationException(elgg_echo('InstallationException:SiteNotInstalled')); } } diff --git a/languages/en.php b/languages/en.php index 5dd1874d7..2806168c6 100644 --- a/languages/en.php +++ b/languages/en.php @@ -36,12 +36,13 @@ $english = array( /** * Errors */ - 'exception:title' => "Welcome to Elgg.", + 'exception:title' => "Fatal Error.", 'actionundefined' => "The requested action (%s) was not defined in the system.", 'actionloggedout' => "Sorry, you cannot perform this action while logged out.", 'actionunauthorized' => 'You are unauthorized to perform this action', + 'InstallationException:SiteNotInstalled' => 'Unable to handle this request. This site is not configured or the database is down.', 'InstallationException:MissingLibrary' => 'Could not load %s', 'InstallationException:CannotLoadSettings' => 'Elgg could not load the settings file. It does not exist or there is a file permissions issue.', diff --git a/views/failsafe/messages/exceptions/exception.php b/views/failsafe/messages/exceptions/exception.php index d3877f0c8..d8c4a5f92 100644 --- a/views/failsafe/messages/exceptions/exception.php +++ b/views/failsafe/messages/exceptions/exception.php @@ -1,6 +1,6 @@ -

+

-debug)) { ?> +debug)) { +?> -

+

- \ No newline at end of file + - - -
+

- - - $vars['sysmessages'])); ?> - -

- -

+