mirror of
https://github.com/phpbb/phpbb.git
synced 2025-01-19 07:08:09 +01:00
[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
This commit is contained in:
parent
d5363bd095
commit
22090dc3a3
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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 = "<?php\n";
|
||||
$config_data .= "// phpBB 3.1.x auto-generated configuration file\n// Do not change anything in this file!\n";
|
||||
@ -526,6 +528,15 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_test
|
||||
$config_data .= "// @define('DEBUG', true);\n";
|
||||
}
|
||||
|
||||
if ($debug_extra)
|
||||
{
|
||||
$config_data .= "@define('DEBUG_EXTRA', true);\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$config_data .= "// @define('DEBUG_EXTRA', true);\n";
|
||||
}
|
||||
|
||||
if ($debug_test)
|
||||
{
|
||||
$config_data .= "@define('DEBUG_TEST', true);\n";
|
||||
|
@ -300,7 +300,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
// because that step will create a config.php file if phpBB has the
|
||||
// permission to do so. We have to create the config file on our own
|
||||
// in order to get the DEBUG constants defined.
|
||||
$config_php_data = phpbb_create_config_file_data(self::$config, self::$config['dbms'], true, true);
|
||||
$config_php_data = phpbb_create_config_file_data(self::$config, self::$config['dbms'], true, false, true);
|
||||
$config_created = file_put_contents($config_file, $config_php_data) !== false;
|
||||
if (!$config_created)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user