diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2015-12-20 12:59:23 +0100 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2015-12-20 12:59:23 +0100 |
| commit | c2a5411dcb50a732585ab72844fed88dc7770edc (patch) | |
| tree | b5ea882c7aa56d38e763ce2b7ee2d87415e04d98 /phpBB/common.php | |
| parent | 96bd53170139816546c17f58f62d38f6e8f259cd (diff) | |
| parent | 6ffbd26377ae7a29dd10f3df5a3a4f76504e7d77 (diff) | |
| download | forums-c2a5411dcb50a732585ab72844fed88dc7770edc.tar forums-c2a5411dcb50a732585ab72844fed88dc7770edc.tar.gz forums-c2a5411dcb50a732585ab72844fed88dc7770edc.tar.bz2 forums-c2a5411dcb50a732585ab72844fed88dc7770edc.tar.xz forums-c2a5411dcb50a732585ab72844fed88dc7770edc.zip | |
Merge pull request #4076 from Nicofuma/ticket/14177
[ticket/14177] Uses Symfony's Debug ErrorHandler in development environment
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')); |
