From 22090dc3a3280d043ff5e77212ee7229b5eb0d24 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 10 Apr 2014 23:02:37 +0200 Subject: [PATCH 1/2] [ticket/12386] Add DEBUG_EXTRA again and use it for container creation We are currently creating a new compiled container on every page load when having DEBUG enabled. However, one might only have that enabled to be presented with errors or for getting the page load stats. This change will add the DEBUG_EXTRA constant again. It will be used for choosing whether the compiled container should be created on every page load - when defined as true - or just once after the cache is cleared. PHPBB3-12386 --- phpBB/includes/functions_container.php | 2 +- phpBB/includes/functions_install.php | 13 ++++++++++++- tests/test_framework/phpbb_functional_test_case.php | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php index 448cb0b7ed..1b1312bfa8 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -239,7 +239,7 @@ function phpbb_create_dumped_container($config_file, array $extensions, array $p */ function phpbb_create_dumped_container_unless_debug($config_file, array $extensions, array $passes, $phpbb_root_path, $php_ext) { - $container_factory = defined('DEBUG') ? 'phpbb_create_compiled_container' : 'phpbb_create_dumped_container'; + $container_factory = defined('DEBUG_EXTRA') ? 'phpbb_create_compiled_container' : 'phpbb_create_dumped_container'; return $container_factory($config_file, $extensions, $passes, $phpbb_root_path, $php_ext); } diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 476535ae5b..406cc4fb03 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -486,12 +486,14 @@ function adjust_language_keys_callback($matches) * @param array $data Array containing the database connection information * @param string $dbms The name of the DBAL class to use * @param bool $debug If the debug constants should be enabled by default or not +* @param bool $debug_extra If the container should be compiled on +* every page load or not * @param bool $debug_test If the DEBUG_TEST constant should be added * NOTE: Only for use within the testing framework * * @return string The output to write to the file */ -function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_test = false) +function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_extra = false, $debug_test = false) { $config_data = " Date: Fri, 11 Apr 2014 11:05:59 +0200 Subject: [PATCH 2/2] [ticket/12386] Rename DEBUG_EXTRA to DEBUG_CONTAINER for more descriptive name PHPBB3-12386 --- phpBB/includes/functions_container.php | 2 +- phpBB/includes/functions_install.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php index 1b1312bfa8..4a01c934bf 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -239,7 +239,7 @@ function phpbb_create_dumped_container($config_file, array $extensions, array $p */ function phpbb_create_dumped_container_unless_debug($config_file, array $extensions, array $passes, $phpbb_root_path, $php_ext) { - $container_factory = defined('DEBUG_EXTRA') ? 'phpbb_create_compiled_container' : 'phpbb_create_dumped_container'; + $container_factory = defined('DEBUG_CONTAINER') ? 'phpbb_create_compiled_container' : 'phpbb_create_dumped_container'; return $container_factory($config_file, $extensions, $passes, $phpbb_root_path, $php_ext); } diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 406cc4fb03..4f8ec99d88 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -486,14 +486,14 @@ function adjust_language_keys_callback($matches) * @param array $data Array containing the database connection information * @param string $dbms The name of the DBAL class to use * @param bool $debug If the debug constants should be enabled by default or not -* @param bool $debug_extra If the container should be compiled on +* @param bool $debug_container If the container should be compiled on * every page load or not * @param bool $debug_test If the DEBUG_TEST constant should be added * NOTE: Only for use within the testing framework * * @return string The output to write to the file */ -function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_extra = false, $debug_test = false) +function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_container = false, $debug_test = false) { $config_data = "