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/common.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/common.php')
| -rw-r--r-- | phpBB/common.php | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index 38761cfadc..48bd13e80d 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -90,8 +90,14 @@ include($phpbb_root_path . 'includes/functions_compatibility.' . $phpEx); require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); -// Set PHP error handler to ours -set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); +if (PHPBB_ENVIRONMENT === 'development') +{ + \phpbb\debug\debug::enable(); +} +else +{ + set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); +} $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx); $phpbb_class_loader_ext->register(); @@ -104,10 +110,17 @@ try } catch (InvalidArgumentException $e) { - trigger_error( - 'The requested environment ' . PHPBB_ENVIRONMENT . ' is not available.', - E_USER_ERROR - ); + if (PHPBB_ENVIRONMENT !== 'development') + { + trigger_error( + 'The requested environment ' . PHPBB_ENVIRONMENT . ' is not available.', + E_USER_ERROR + ); + } + else + { + throw $e; + } } $phpbb_class_loader->set_cache($phpbb_container->get('cache.driver')); |
