From dee22f4a281335b51333ff493b34c026f36e1804 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 11 Dec 2015 21:05:53 +0100 Subject: [ticket/14177] Uses Symfony's Debug ErrorHandler in development environment PHPBB3-14177 --- phpBB/phpbb/debug/error_handler.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 phpBB/phpbb/debug/error_handler.php (limited to 'phpBB/phpbb/debug/error_handler.php') diff --git a/phpBB/phpbb/debug/error_handler.php b/phpBB/phpbb/debug/error_handler.php new file mode 100644 index 0000000000..2b182628a8 --- /dev/null +++ b/phpBB/phpbb/debug/error_handler.php @@ -0,0 +1,32 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\debug; + +use Symfony\Component\Debug\ErrorHandler; +use Symfony\Component\Filesystem\Exception\IOException; + +class error_handler extends ErrorHandler +{ + public function handleError($type, $message, $file, $line, array $context, array $backtrace = null) + { + if ($type === E_USER_WARNING|| $type === E_USER_NOTICE) + { + $handler = defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'; + + $handler($type, $message, $file, $line); + } + + return parent::handleError($type, $message, $file, $line, $context, $backtrace); + } +} -- cgit v1.2.1