mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Merge pull request #3285 from MGaetan89/ticket/13497
[ticket/13497] Change get_tables() calls with $db_tools->sql_list_tables()
This commit is contained in:
commit
e5104b5d53
3 changed files with 19 additions and 15 deletions
|
@ -384,3 +384,16 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false, $
|
||||||
}
|
}
|
||||||
return $tmp_request->variable($var_name, $default, $multibyte, ($cookie) ? \phpbb\request\request_interface::COOKIE : \phpbb\request\request_interface::REQUEST);
|
return $tmp_request->variable($var_name, $default, $multibyte, ($cookie) ? \phpbb\request\request_interface::COOKIE : \phpbb\request\request_interface::REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get tables of a database
|
||||||
|
*
|
||||||
|
* @deprecated 3.1.0 (To be removed: 3.3.0)
|
||||||
|
*/
|
||||||
|
function get_tables(&$db)
|
||||||
|
{
|
||||||
|
$db_tools_factory = new \phpbb\db\tools\factory();
|
||||||
|
$db_tools = $db_tools_factory->get($db);
|
||||||
|
|
||||||
|
return $db_tools->sql_list_tables();
|
||||||
|
}
|
||||||
|
|
|
@ -181,19 +181,6 @@ function dbms_select($default = '', $only_20x_options = false)
|
||||||
return $dbms_options;
|
return $dbms_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get tables of a database
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
function get_tables(&$db)
|
|
||||||
{
|
|
||||||
$factory = new \phpbb\db\tools\factory();
|
|
||||||
$db_tools = $factory->get($db);
|
|
||||||
|
|
||||||
return $db_tools->sql_list_tables();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to test whether we are able to connect to the database the user has specified
|
* Used to test whether we are able to connect to the database the user has specified
|
||||||
* and identify any problems (eg there are already tables with the names we want to use
|
* and identify any problems (eg there are already tables with the names we want to use
|
||||||
|
@ -277,7 +264,9 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
|
||||||
$temp_prefix = strtolower($table_prefix);
|
$temp_prefix = strtolower($table_prefix);
|
||||||
$table_ary = array($temp_prefix . 'attachments', $temp_prefix . 'config', $temp_prefix . 'sessions', $temp_prefix . 'topics', $temp_prefix . 'users');
|
$table_ary = array($temp_prefix . 'attachments', $temp_prefix . 'config', $temp_prefix . 'sessions', $temp_prefix . 'topics', $temp_prefix . 'users');
|
||||||
|
|
||||||
$tables = get_tables($db);
|
$db_tools_factory = new \phpbb\db\tools\factory();
|
||||||
|
$db_tools = $db_tools_factory->get($db);
|
||||||
|
$tables = $db_tools->sql_list_tables();
|
||||||
$tables = array_map('strtolower', $tables);
|
$tables = array_map('strtolower', $tables);
|
||||||
$table_intersect = array_intersect($tables, $table_ary);
|
$table_intersect = array_intersect($tables, $table_ary);
|
||||||
|
|
||||||
|
|
|
@ -491,7 +491,9 @@ class install_convert extends module
|
||||||
{
|
{
|
||||||
$prefixes = array();
|
$prefixes = array();
|
||||||
|
|
||||||
$tables_existing = get_tables($src_db);
|
$db_tools_factory = new \phpbb\db\tools\factory();
|
||||||
|
$db_tools = $db_tools_factory->get($src_db);
|
||||||
|
$tables_existing = $db_tools->sql_list_tables();
|
||||||
$tables_existing = array_map('strtolower', $tables_existing);
|
$tables_existing = array_map('strtolower', $tables_existing);
|
||||||
foreach ($tables_existing as $table_name)
|
foreach ($tables_existing as $table_name)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue