mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-19 07:41:08 +01:00
- only give DBAL options which were available in phpBB2
- default to phpBB3 DB config git-svn-id: file:///svn/phpbb/trunk@6996 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
7259457701
commit
e526dfe83e
@ -27,7 +27,7 @@ function can_load_dll($dll)
|
||||
* Returns an array of available DBMS with some data, if a DBMS is specified it will only
|
||||
* return data for that DBMS and will load its extension if necessary.
|
||||
*/
|
||||
function get_available_dbms($dbms = false, $return_unavailable = false)
|
||||
function get_available_dbms($dbms = false, $return_unavailable = false, $only_20x_options = false)
|
||||
{
|
||||
$available_dbms = array(
|
||||
'firebird' => array(
|
||||
@ -38,6 +38,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false)
|
||||
'COMMENTS' => 'remove_remarks',
|
||||
'DRIVER' => 'firebird',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => false,
|
||||
),
|
||||
'mysqli' => array(
|
||||
'LABEL' => 'MySQL with MySQLi Extension',
|
||||
@ -47,6 +48,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false)
|
||||
'COMMENTS' => 'remove_remarks',
|
||||
'DRIVER' => 'mysqli',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => true,
|
||||
),
|
||||
'mysql' => array(
|
||||
'LABEL' => 'MySQL',
|
||||
@ -56,6 +58,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false)
|
||||
'COMMENTS' => 'remove_remarks',
|
||||
'DRIVER' => 'mysql',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => true,
|
||||
),
|
||||
'mssql' => array(
|
||||
'LABEL' => 'MS SQL Server 2000+',
|
||||
@ -65,6 +68,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false)
|
||||
'COMMENTS' => 'remove_comments',
|
||||
'DRIVER' => 'mssql',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => true,
|
||||
),
|
||||
'mssql_odbc'=> array(
|
||||
'LABEL' => 'MS SQL Server [ ODBC ]',
|
||||
@ -74,6 +78,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false)
|
||||
'COMMENTS' => 'remove_comments',
|
||||
'DRIVER' => 'mssql_odbc',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => true,
|
||||
),
|
||||
'oracle' => array(
|
||||
'LABEL' => 'Oracle',
|
||||
@ -83,6 +88,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false)
|
||||
'COMMENTS' => 'remove_comments',
|
||||
'DRIVER' => 'oracle',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => false,
|
||||
),
|
||||
'postgres' => array(
|
||||
'LABEL' => 'PostgreSQL 7.x/8.x',
|
||||
@ -92,6 +98,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false)
|
||||
'COMMENTS' => 'remove_comments',
|
||||
'DRIVER' => 'postgres',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => true,
|
||||
),
|
||||
'sqlite' => array(
|
||||
'LABEL' => 'SQLite',
|
||||
@ -101,6 +108,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false)
|
||||
'COMMENTS' => 'remove_remarks',
|
||||
'DRIVER' => 'sqlite',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => false,
|
||||
),
|
||||
);
|
||||
|
||||
@ -119,6 +127,19 @@ function get_available_dbms($dbms = false, $return_unavailable = false)
|
||||
// now perform some checks whether they are really available
|
||||
foreach ($available_dbms as $db_name => $db_ary)
|
||||
{
|
||||
if ($only_20x_options && !$db_ary['2.0.x'])
|
||||
{
|
||||
if ($return_unavailable)
|
||||
{
|
||||
$available_dbms[$db_name]['AVAILABLE'] = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($available_dbms[$db_name]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
$dll = $db_ary['MODULE'];
|
||||
|
||||
if (!@extension_loaded($dll))
|
||||
@ -149,9 +170,9 @@ function get_available_dbms($dbms = false, $return_unavailable = false)
|
||||
/**
|
||||
* Generate the drop down of available database options
|
||||
*/
|
||||
function dbms_select($default='')
|
||||
function dbms_select($default = '', $only_20x_options = false)
|
||||
{
|
||||
$available_dbms = get_available_dbms();
|
||||
$available_dbms = get_available_dbms(false, false, $only_20x_options);
|
||||
$dbms_options = '';
|
||||
foreach ($available_dbms as $dbms_name => $details)
|
||||
{
|
||||
|
@ -22,6 +22,9 @@ if (!defined('IN_PHPBB'))
|
||||
exit;
|
||||
}
|
||||
|
||||
include($phpbb_root_path . 'config.' . $phpEx);
|
||||
unset($dbpasswd);
|
||||
|
||||
/**
|
||||
* $convertor_data provides some basic information about this convertor which is
|
||||
* used on the initial list of convertors and to populate the default settings
|
||||
@ -31,12 +34,12 @@ $convertor_data = array(
|
||||
'version' => '0.9',
|
||||
'phpbb_version' => '3.0.0',
|
||||
'author' => '<a href="http://www.phpbb.com/">phpBB Group</a>',
|
||||
'dbms' => 'mysql',
|
||||
'dbhost' => 'localhost',
|
||||
'dbport' => '',
|
||||
'dbuser' => 'user',
|
||||
'dbpasswd' => 'password',
|
||||
'dbname' => '',
|
||||
'dbms' => $dbms,
|
||||
'dbhost' => $dbhost,
|
||||
'dbport' => $dbport,
|
||||
'dbuser' => $dbuser,
|
||||
'dbpasswd' => '',
|
||||
'dbname' => $dbname,
|
||||
'table_prefix' => 'phpbb_',
|
||||
'forum_path' => '../forums',
|
||||
'author_notes' => 'Avatars may be on a different width/height than with the old forum. This is due to dimensions being stored within phpBB3 but not within phpBB2. The default dimension was set to 80x80 for avatars where dimension settings could not be determined. You might wish to instruct your users to check their profiles after the conversion to ensure that the size is correct.',
|
||||
|
@ -397,7 +397,7 @@ class install_convert extends module
|
||||
}
|
||||
|
||||
$connect_test = false;
|
||||
$available_dbms = get_available_dbms(false, true);
|
||||
$available_dbms = get_available_dbms(false, true, true);
|
||||
|
||||
if (!isset($available_dbms[$src_dbms]) || !$available_dbms[$src_dbms]['AVAILABLE'])
|
||||
{
|
||||
@ -2110,7 +2110,7 @@ class install_convert extends module
|
||||
*/
|
||||
var $convert_options = array(
|
||||
'legend1' => 'SPECIFY_OPTIONS',
|
||||
'src_dbms' => array('lang' => 'DBMS', 'type' => 'select', 'options' => 'dbms_select(\'{VALUE}\')', 'explain' => false),
|
||||
'src_dbms' => array('lang' => 'DBMS', 'type' => 'select', 'options' => 'dbms_select(\'{VALUE}\', true)', 'explain' => false),
|
||||
'src_dbhost' => array('lang' => 'DB_HOST', 'type' => 'text:25:100', 'explain' => true),
|
||||
'src_dbport' => array('lang' => 'DB_PORT', 'type' => 'text:25:100', 'explain' => true),
|
||||
'src_dbname' => array('lang' => 'DB_NAME', 'type' => 'text:25:100', 'explain' => false),
|
||||
|
Loading…
x
Reference in New Issue
Block a user