From 394a95b5c5c048e9c606f5fc05e512ddc40e5ded Mon Sep 17 00:00:00 2001 From: Shibu Lijack Date: Wed, 11 Apr 2012 17:54:50 +0530 Subject: [ticket/10688] Updated version to 3.1 Replace phpBB 3.0.x to phpBB 3.1.x PHPBB-10688 --- phpBB/includes/functions_install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_install.php') diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index a49e19f09a..c1250bac27 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -516,7 +516,7 @@ function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug = $load_extensions = implode(',', $load_extensions); $config_data = " $dbms, -- cgit v1.2.1 From de70b17b1dc19e19faa0d56395a1aba8868c9624 Mon Sep 17 00:00:00 2001 From: Patrick Webster Date: Fri, 20 Apr 2012 23:50:49 -0500 Subject: [ticket/10492] Separate config generation from the installer PHPBB3-10492 --- phpBB/includes/functions_install.php | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'phpBB/includes/functions_install.php') diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 6caa5c943f..633b2755f0 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -512,4 +512,56 @@ function adjust_language_keys_callback($matches) } } +/** +* Creates the output to be stored in a phpBB config.php file +* +* @param array $data Array containing the database connection information +* @param string $dbms The name of the DBAL class to use +* @param array $load_extensions Array of additional extensions that should be loaded +* @param bool $debug If the debug constants should be enabled by default or not +* +* @return string The output to write to the file +*/ +function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug = false) +{ + $load_extensions = implode(',', $load_extensions); + + $config_data = " $dbms, + 'dbhost' => $data['dbhost'], + 'dbport' => $data['dbport'], + 'dbname' => $data['dbname'], + 'dbuser' => $data['dbuser'], + 'dbpasswd' => htmlspecialchars_decode($data['dbpasswd']), + 'table_prefix' => $data['table_prefix'], + 'acm_type' => 'file', + 'load_extensions' => $load_extensions, + ); + + foreach ($config_data_array as $key => $value) + { + $config_data .= "\${$key} = '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $value)) . "';\n"; + } + + $config_data .= "\n@define('PHPBB_INSTALLED', true);\n"; + + if ($debug) + { + $config_data .= "@define('DEBUG', true);\n"; + $config_data .= "@define('DEBUG_EXTRA', true);\n"; + } + else + { + $config_data .= "// @define('DEBUG', true);\n"; + $config_data .= "// @define('DEBUG_EXTRA', true);\n"; + } + + $config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! + + return $config_data; +} + ?> \ No newline at end of file -- cgit v1.2.1 From 70be7e109f067d6f6d1add488338294dd59c7785 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 18 May 2012 11:15:53 +0200 Subject: [ticket/10898] Do not write ?> into config.php to avoid whitespace output. PHPBB3-10898 --- phpBB/includes/functions_install.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'phpBB/includes/functions_install.php') diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 633b2755f0..9e9c48ff58 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -559,8 +559,6 @@ function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug = $config_data .= "// @define('DEBUG_EXTRA', true);\n"; } - $config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! - return $config_data; } -- cgit v1.2.1