diff options
author | Igor Wiedler <igor@wiedler.ch> | 2011-10-14 17:24:03 +0200 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2011-10-14 17:24:03 +0200 |
commit | 207a73537b2bb7f4608509f3ec79aaa313608ccb (patch) | |
tree | 0bfdefa599ff24a51e9063619e513ab2ebcbd19a /phpBB | |
parent | 37d9e7e30c3edbd14bb4e0f098ce676f1d7fe07b (diff) | |
parent | a8aa7fd6c094dcba20c45c6e81928c5a6942c48b (diff) | |
download | forums-207a73537b2bb7f4608509f3ec79aaa313608ccb.tar forums-207a73537b2bb7f4608509f3ec79aaa313608ccb.tar.gz forums-207a73537b2bb7f4608509f3ec79aaa313608ccb.tar.bz2 forums-207a73537b2bb7f4608509f3ec79aaa313608ccb.tar.xz forums-207a73537b2bb7f4608509f3ec79aaa313608ccb.zip |
Merge remote-tracking branch 'naderman/feature/functional-tests' into develop
* naderman/feature/functional-tests:
[feature/functional-tests] Don't add elements to backup list twice
[feature/functional-tests] Generate config correctly and install only once
[feature/functional-tests] Configure functional tests through config file
[feature/functional-tests] Implementing functional test framework with goutte
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions_install.php | 44 | ||||
-rw-r--r-- | phpBB/install/install_install.php | 27 |
2 files changed, 44 insertions, 27 deletions
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 4746b2f6e1..7742bb9263 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -104,7 +104,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'DRIVER' => 'mssqlnative', 'AVAILABLE' => true, '2.0.x' => false, - ), + ), 'oracle' => array( 'LABEL' => 'Oracle', 'SCHEMA' => 'oracle', @@ -555,3 +555,45 @@ function adjust_language_keys_callback($matches) return (!empty($lang[$matches[1]])) ? $db->sql_escape($lang[$matches[1]]) : $db->sql_escape($matches[1]); } } + +function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug = false) +{ + $load_extensions = implode(',', $load_extensions); + + $config_data = "<?php\n"; + $config_data .= "// phpBB 3.0.x auto-generated configuration file\n// Do not change anything in this file!\n"; + + $config_data_array = array( + 'dbms' => $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; +} diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index f8c54678bf..439bebf27e 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -876,33 +876,8 @@ class install_install extends module @chmod($phpbb_root_path . 'cache/install_lock', 0777); - $load_extensions = implode(',', $load_extensions); - // Time to convert the data provided into a config file - $config_data = "<?php\n"; - $config_data .= "// phpBB 3.0.x auto-generated configuration file\n// Do not change anything in this file!\n"; - - $config_data_array = array( - 'dbms' => $available_dbms[$data['dbms']]['DRIVER'], - '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"; - } - unset($config_data_array); - - $config_data .= "\n@define('PHPBB_INSTALLED', true);\n"; - $config_data .= "// @define('DEBUG', true);\n"; - $config_data .= "// @define('DEBUG_EXTRA', true);\n"; + $config_data = phpbb_create_config_file_data($data, $available_dbms[$data['dbms']]['DRIVER'], $load_extensions); // Attempt to write out the config file directly. If it works, this is the easiest way to do it ... if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx)) || phpbb_is_writable($phpbb_root_path)) |