diff options
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 1 | ||||
-rw-r--r-- | phpBB/includes/functions_convert.php | 18 | ||||
-rw-r--r-- | phpBB/install/convertors/convert_phpbb20.php | 11 |
3 files changed, 27 insertions, 3 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 43f4311600..b6b2503968 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -154,6 +154,7 @@ <li>[Fix] Do not store email templates in database. (Bug #54505)</li> <li>[Fix] Fix javascript bug in the smilies ACP. (Bug #55725)</li> <li>[Fix] Unify BBCode Selection across browsers. (Bug #38765)</li> + <li>[Fix] Allow convertors to read in configuration from files. (Bug #57265) (patch by Dicky)</li> <li>[Change] Move redirect into a hidden field to avoid issues with mod_security. (Bug #54145)</li> <li>[Change] Log activation through inactive users ACP. (Bug #30145)</li> <li>[Change] Send time of last item instead of current time in ATOM Feeds. (Bug #53305)</li> diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 82ec114c09..8a1d07c8e5 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1232,6 +1232,11 @@ function get_config() $convert->p_master->error($user->lang['FILE_NOT_FOUND'] . ': ' . $filename, __LINE__, __FILE__); } + if (isset($convert->config_schema['array_name'])) + { + unset($convert->config_schema['array_name']); + } + $convert_config = extract_variables_from_file($filename); if (!empty($convert->config_schema['array_name'])) { @@ -1264,6 +1269,7 @@ function restore_config($schema) global $db, $config; $convert_config = get_config(); + foreach ($schema['settings'] as $config_name => $src) { if (preg_match('/(.*)\((.*)\)/', $src, $m)) @@ -1274,8 +1280,16 @@ function restore_config($schema) } else { - $config_value = (isset($convert_config[$src])) ? $convert_config[$src] : ''; - } + if ($schema['table_format'] != 'file' || empty($schema['array_name'])) + { + $config_value = (isset($convert_config[$src])) ? $convert_config[$src] : ''; + } + else if (!empty($schema['array_name'])) + { + $src_ary = $schema['array_name']; + $config_value = (isset($convert_config[$src_ary][$src])) ? $convert_config[$src_ary][$src] : ''; + } + } if ($config_value !== '') { diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 5a6603883b..1d6b79bbec 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -32,7 +32,7 @@ unset($dbpasswd); $convertor_data = array( 'forum_name' => 'phpBB 2.0.x', 'version' => '1.0.3', - 'phpbb_version' => '3.0.6', + 'phpbb_version' => '3.0.7', 'author' => '<a href="http://www.phpbb.com/">phpBB Group</a>', 'dbms' => $dbms, 'dbhost' => $dbhost, @@ -78,6 +78,15 @@ $tables = array( * * 'table_format' can take the value 'file' to indicate a config file. In this case array_name * is set to indicate the name of the array the config values are stored in +* Example of using a file: +* $config_schema = array( +* 'table_format' => 'file', +* 'filename' => 'NAME OF FILE', // If the file is not in the root directory, the path needs to be added with no leading slash +* 'array_name' => 'NAME OF ARRAY', // Only used if the configuration file stores the setting in an array. +* 'settings' => array( +* 'board_email' => 'SUPPORT_EMAIL', // target config name => source target name +* ) +* ); * 'table_format' can be an array if the values are stored in a table which is an assosciative array * (as per phpBB 2.0.x) * If left empty, values are assumed to be stored in a table where each config setting is |