diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2013-11-28 08:56:05 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2013-11-28 08:56:05 +0400 |
commit | c115623846299a3d7c9c13c946bf4298fd60d80a (patch) | |
tree | 4a14f9b819f88a623c045ab1334eadbf0508fed7 /index.php | |
parent | a5571bd4b69218d0a28e95a76d25eb401001b41c (diff) |
if a plugin causes a fatal error, offer the possibility to disable or uninstall the plugin, work is still in progress
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -52,6 +52,19 @@ 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; + } +}); + if (!defined('PIWIK_ENABLE_DISPATCH') || PIWIK_ENABLE_DISPATCH) { $controller = FrontController::getInstance(); $controller->init(); |