From 8318219cad363e3430080b0609fa281227dc7892 Mon Sep 17 00:00:00 2001 From: mattab Date: Thu, 26 Dec 2013 10:42:07 +1300 Subject: Refs #4439 Registering the callback in the frontcontroller and using a static method rather than a closure --- index.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 892050501c..bde70bb7ba 100644 --- a/index.php +++ b/index.php @@ -54,18 +54,7 @@ if (!defined('PIWIK_ENABLE_ERROR_HANDLER') || PIWIK_ENABLE_ERROR_HANDLER) { ExceptionHandler::setUp(); } -register_shutdown_function(function () { - - $lastError = error_get_last(); - - if (!empty($lastError) && $lastError['type'] == E_ERROR) { - $controller = FrontController::getInstance(); - $controller->init(); - $message = $controller->dispatch('CorePluginsAdmin', 'safemode', array($lastError)); - - echo $message; - } -}); +FrontController::setUpSafeMode(); if (!defined('PIWIK_ENABLE_DISPATCH') || PIWIK_ENABLE_DISPATCH) { $controller = FrontController::getInstance(); -- cgit v1.2.3