diff --git a/phpBB/config/development/config.yml b/phpBB/config/development/config.yml index e09cf7455f..00ca9c341d 100644 --- a/phpBB/config/development/config.yml +++ b/phpBB/config/development/config.yml @@ -19,3 +19,6 @@ core: extensions: composer_debug: true composer_verbose: true + + session: + log_errors: true diff --git a/phpBB/phpbb/di/extension/container_configuration.php b/phpBB/phpbb/di/extension/container_configuration.php index 86771a1de0..5a6980fa15 100644 --- a/phpBB/phpbb/di/extension/container_configuration.php +++ b/phpBB/phpbb/di/extension/container_configuration.php @@ -56,6 +56,12 @@ class container_configuration implements ConfigurationInterface ->booleanNode('composer_verbose')->defaultValue(false)->end() ->end() ->end() + ->arrayNode('session') + ->addDefaultsIfNotSet() + ->children() + ->booleanNode('log_errors')->defaultValue(false)->end() + ->end() + ->end() ->end() ; return $treeBuilder; diff --git a/phpBB/phpbb/di/extension/core.php b/phpBB/phpbb/di/extension/core.php index cdba25f13b..65848cdadf 100644 --- a/phpBB/phpbb/di/extension/core.php +++ b/phpBB/phpbb/di/extension/core.php @@ -112,6 +112,12 @@ class core extends Extension { $container->setParameter('debug.' . $name, $value); } + + // Set the log options + foreach ($config['session'] as $name => $value) + { + $container->setParameter('session.' . $name, $value); + } } /** diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index 1b1bc3a428..7d40d4ef87 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -481,7 +481,7 @@ class session else { // Added logging temporarily to help debug bugs... - if (defined('DEBUG') && $this->data['user_id'] != ANONYMOUS) + if ($phpbb_container->getParameter('session.log_errors') && $this->data['user_id'] != ANONYMOUS) { if ($referer_valid) { diff --git a/tests/mock/container_builder.php b/tests/mock/container_builder.php index 05083c3a3c..17c4ae22dd 100644 --- a/tests/mock/container_builder.php +++ b/tests/mock/container_builder.php @@ -21,6 +21,7 @@ class phpbb_mock_container_builder implements ContainerInterface public function __construct() { $this->setParameter('debug.load_time', false); + $this->setParameter('session.log_errors', false); } /**