]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed php exception and error handlers not being next to each other in elgglib
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 30 Oct 2010 22:00:56 +0000 (22:00 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 30 Oct 2010 22:00:56 +0000 (22:00 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7142 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/elgglib.php

index 1b078fde747814787e9ee472e211b87dceccd265..60c4e11ad346c65aeb57068795a05a2b10af9dae 100644 (file)
@@ -865,6 +865,34 @@ function trigger_plugin_hook($hook, $type, $params = null, $returnvalue = null)
        return $returnvalue;
 }
 
+/**
+ * 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.
  *
@@ -1010,34 +1038,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.
  *