From 9755e8b775969bbb5ea59e8776623687f41fa8df Mon Sep 17 00:00:00 2001 From: Yuriy Pikhtarev Date: Thu, 8 Jun 2017 23:20:50 +0300 Subject: [PATCH] Whoops error handler for debug users. --- common.php | 9 +++++++++ composer.json | 1 + 2 files changed, 10 insertions(+) diff --git a/common.php b/common.php index 084acf3c6..ae0bf842a 100644 --- a/common.php +++ b/common.php @@ -108,6 +108,15 @@ define('TOR_TYPE_SILVER', 2); define('GUEST_UID', -1); define('BOT_UID', -746); +/** + * Whoops error handler + */ +if (DBG_USER) { + $whoops = new \Whoops\Run; + $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler); + $whoops->register(); +} + /** * Database */ diff --git a/composer.json b/composer.json index 6e29f50de..8b65ba8cc 100644 --- a/composer.json +++ b/composer.json @@ -37,6 +37,7 @@ "require": { "php": "^5.5 || ^7.0", "bugsnag/bugsnag": "^3.0", + "filp/whoops": "^2.1", "gigablah/sphinxphp": "^2.0", "google/recaptcha": "^1.0", "longman/ip-tools": "^1.2",