diff options
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, | 
