diff options
author | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-12-11 21:05:53 +0100 |
---|---|---|
committer | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-12-11 21:05:53 +0100 |
commit | dee22f4a281335b51333ff493b34c026f36e1804 (patch) | |
tree | 1d6c39db128c090fbb0be5f62e0e4d5400e9fa95 /phpBB/phpbb/debug/error_handler.php | |
parent | 7c05b881c5534520e978785ca6d27cad826fbc67 (diff) | |
download | forums-dee22f4a281335b51333ff493b34c026f36e1804.tar forums-dee22f4a281335b51333ff493b34c026f36e1804.tar.gz forums-dee22f4a281335b51333ff493b34c026f36e1804.tar.bz2 forums-dee22f4a281335b51333ff493b34c026f36e1804.tar.xz forums-dee22f4a281335b51333ff493b34c026f36e1804.zip |
[ticket/14177] Uses Symfony's Debug ErrorHandler in development environment
PHPBB3-14177
Diffstat (limited to 'phpBB/phpbb/debug/error_handler.php')
-rw-r--r-- | phpBB/phpbb/debug/error_handler.php | 32 |
1 files changed, 32 insertions, 0 deletions
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 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @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); + } +} |