Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2013-11-28 08:56:05 +0400
committerThomas Steur <thomas.steur@gmail.com>2013-11-28 08:56:05 +0400
commitc115623846299a3d7c9c13c946bf4298fd60d80a (patch)
tree4a14f9b819f88a623c045ab1334eadbf0508fed7 /index.php
parenta5571bd4b69218d0a28e95a76d25eb401001b41c (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.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/index.php b/index.php
index d0c197362c..d4882019a4 100644
--- a/index.php
+++ b/index.php
@@ -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();