diff --git a/phpBB/config/development/config.yml b/phpBB/config/development/config.yml index 00ca9c341d..e3eb537806 100644 --- a/phpBB/config/development/config.yml +++ b/phpBB/config/development/config.yml @@ -10,6 +10,7 @@ core: load_time: true sql_explain: true memory: true + show_errors: true twig: debug: true diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index aa8a6e743f..11d4dfd6ba 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3269,6 +3269,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) { global $cache, $db, $auth, $template, $config, $user, $request; global $phpbb_root_path, $msg_title, $msg_long_text, $phpbb_log; + global $phpbb_container; // Do not display notices if we suppress them via @ if (error_reporting() == 0 && $errno != E_USER_ERROR && $errno != E_USER_WARNING && $errno != E_USER_NOTICE) @@ -3289,7 +3290,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) // Check the error reporting level and return if the error level does not match // If DEBUG is defined the default level is E_ALL - if (($errno & ((defined('DEBUG')) ? E_ALL : error_reporting())) == 0) + if (($errno & ($phpbb_container->getParameter('debug.show_errors') ? E_ALL : error_reporting())) == 0) { return; } @@ -3347,7 +3348,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) $log_text .= '

BACKTRACE
' . $backtrace; } - if (defined('IN_INSTALL') || defined('DEBUG') || isset($auth) && $auth->acl_get('a_')) + if (defined('IN_INSTALL') || $phpbb_container->getParameter('debug.show_errors') || isset($auth) && $auth->acl_get('a_')) { $msg_text = $log_text; diff --git a/phpBB/phpbb/di/extension/container_configuration.php b/phpBB/phpbb/di/extension/container_configuration.php index 5a6980fa15..a1e0a4c297 100644 --- a/phpBB/phpbb/di/extension/container_configuration.php +++ b/phpBB/phpbb/di/extension/container_configuration.php @@ -39,6 +39,7 @@ class container_configuration implements ConfigurationInterface ->booleanNode('load_time')->defaultValue(false)->end() ->booleanNode('sql_explain')->defaultValue(false)->end() ->booleanNode('memory')->defaultValue(false)->end() + ->booleanNode('show_errors')->defaultValue(false)->end() ->end() ->end() ->arrayNode('twig') diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php index 3c732ff49b..58234e82b4 100644 --- a/tests/controller/common_helper_route.php +++ b/tests/controller/common_helper_route.php @@ -139,7 +139,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case new \phpbb\routing\file_locator(dirname(__FILE__) . '/') ); $resources_locator = new \phpbb\routing\resources_locator\default_resources_locator(dirname(__FILE__) . '/', PHPBB_ENVIRONMENT, $this->extension_manager); - $this->router = new phpbb_mock_router($container, $resources_locator, $loader, dirname(__FILE__) . '/', 'php'); + $this->router = new phpbb_mock_router($container, $resources_locator, $loader, dirname(__FILE__) . '/', 'php', false); // Set correct current phpBB root path $this->root_path = $this->get_phpbb_root_path(); diff --git a/tests/controller/controller_test.php b/tests/controller/controller_test.php index 3bab158ac8..7b9f92d048 100644 --- a/tests/controller/controller_test.php +++ b/tests/controller/controller_test.php @@ -48,7 +48,7 @@ class phpbb_controller_controller_test extends phpbb_test_case new \phpbb\routing\file_locator(dirname(__FILE__) . '/') ); $resources_locator = new \phpbb\routing\resources_locator\default_resources_locator(dirname(__FILE__) . '/', PHPBB_ENVIRONMENT, $this->extension_manager); - $router = new phpbb_mock_router($container, $resources_locator, $loader, dirname(__FILE__) . '/', 'php'); + $router = new phpbb_mock_router($container, $resources_locator, $loader, dirname(__FILE__) . '/', 'php', false); $routes = $router->get_routes(); // This will need to be updated if any new routes are defined diff --git a/tests/pagination/pagination_test.php b/tests/pagination/pagination_test.php index a9c78059a5..be20d79282 100644 --- a/tests/pagination/pagination_test.php +++ b/tests/pagination/pagination_test.php @@ -46,7 +46,7 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case new \phpbb\routing\file_locator(dirname(__FILE__) . '/') ); $resources_locator = new \phpbb\routing\resources_locator\default_resources_locator(dirname(__FILE__) . '/', PHPBB_ENVIRONMENT, $manager); - $router = new phpbb_mock_router(new phpbb_mock_container_builder(), $resources_locator, $loader, dirname(__FILE__) . '/', 'php'); + $router = new phpbb_mock_router(new phpbb_mock_container_builder(), $resources_locator, $loader, dirname(__FILE__) . '/', 'php', false); $request = new phpbb_mock_request(); $request->overwrite('SCRIPT_NAME', '/app.php', \phpbb\request\request_interface::SERVER);