diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-30 22:00:56 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-30 22:00:56 +0000 |
commit | ba5681722bbb3df247cda8eb3f64c7e040e5bf00 (patch) | |
tree | 9d140d99c94bdec45ea47e8bffc9c5e9b8ad55c6 /engine/lib | |
parent | 9795d6a9451c98ae9ea624d4513c3d9c28a78d1a (diff) | |
download | elgg-ba5681722bbb3df247cda8eb3f64c7e040e5bf00.tar.gz elgg-ba5681722bbb3df247cda8eb3f64c7e040e5bf00.tar.bz2 |
fixed php exception and error handlers not being next to each other in elgglib
git-svn-id: http://code.elgg.org/elgg/trunk@7142 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/elgglib.php | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 1b078fde7..60c4e11ad 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -866,6 +866,34 @@ function trigger_plugin_hook($hook, $type, $params = null, $returnvalue = null) } /** + * Intercepts, logs, and display uncaught exceptions. + * + * @warning This function should never be called directly. + * + * @see http://www.php.net/set-exception-handler + * + * @param Exception $exception The exception being handled + * + * @return void + */ +function _elgg_php_exception_handler($exception) { + error_log("*** FATAL EXCEPTION *** : " . $exception); + + // Wipe any existing output buffer + ob_end_clean(); + + // 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); + // @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); +} + +/** * Intercepts catchable PHP errors. * * @warning This function should never be called directly. @@ -1011,34 +1039,6 @@ function elgg_dump($value, $to_screen = TRUE, $level = 'NOTICE') { } /** - * Intercepts, logs, and display uncaught exceptions. - * - * @warning This function should never be called directly. - * - * @see http://www.php.net/set-exception-handler - * - * @param Exception $exception The exception being handled - * - * @return void - */ -function _elgg_php_exception_handler($exception) { - error_log("*** FATAL EXCEPTION *** : " . $exception); - - // Wipe any existing output buffer - ob_end_clean(); - - // 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); - // @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); -} - -/** * Sends a notice about deprecated use of a function, view, etc. * * This function either displays or logs the deprecation message, |