aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/config/db.php2
-rw-r--r--phpBB/includes/cron/task/core/prune_all_forums.php2
-rw-r--r--phpBB/includes/cron/task/core/prune_forum.php2
-rw-r--r--phpBB/includes/cron/task/core/tidy_search.php2
-rw-r--r--phpBB/includes/db/db_tools.php2
-rw-r--r--phpBB/includes/db/driver/driver.php (renamed from phpBB/includes/db/dbal.php)17
-rw-r--r--phpBB/includes/db/driver/firebird.php (renamed from phpBB/includes/db/firebird.php)4
-rw-r--r--phpBB/includes/db/driver/mssql.php (renamed from phpBB/includes/db/mssql.php)4
-rw-r--r--phpBB/includes/db/driver/mssql_odbc.php (renamed from phpBB/includes/db/mssql_odbc.php)4
-rw-r--r--phpBB/includes/db/driver/mssqlnative.php (renamed from phpBB/includes/db/mssqlnative.php)4
-rw-r--r--phpBB/includes/db/driver/mysql.php (renamed from phpBB/includes/db/mysql.php)4
-rw-r--r--phpBB/includes/db/driver/mysqli.php (renamed from phpBB/includes/db/mysqli.php)4
-rw-r--r--phpBB/includes/db/driver/oracle.php (renamed from phpBB/includes/db/oracle.php)4
-rw-r--r--phpBB/includes/db/driver/postgres.php (renamed from phpBB/includes/db/postgres.php)9
-rw-r--r--phpBB/includes/db/driver/sqlite.php (renamed from phpBB/includes/db/sqlite.php)4
-rw-r--r--phpBB/includes/di/extension/config.php12
-rw-r--r--phpBB/includes/extension/manager.php4
-rw-r--r--phpBB/includes/extension/metadata_manager.php4
-rw-r--r--phpBB/includes/functions.php21
-rw-r--r--phpBB/includes/functions_download.php8
-rw-r--r--phpBB/includes/functions_install.php59
-rw-r--r--phpBB/includes/lock/db.php6
-rw-r--r--phpBB/includes/questionnaire/questionnaire.php2
-rw-r--r--phpBB/includes/search/fulltext_mysql.php4
-rw-r--r--phpBB/includes/search/fulltext_native.php4
-rw-r--r--phpBB/includes/search/fulltext_postgres.php4
-rw-r--r--phpBB/includes/search/fulltext_sphinx.php4
27 files changed, 94 insertions, 106 deletions
diff --git a/phpBB/includes/config/db.php b/phpBB/includes/config/db.php
index 45f9f1cb21..ed86383b6b 100644
--- a/phpBB/includes/config/db.php
+++ b/phpBB/includes/config/db.php
@@ -46,7 +46,7 @@ class phpbb_config_db extends phpbb_config
* @param phpbb_cache_driver_interface $cache Cache instance
* @param string $table Configuration table name
*/
- public function __construct(dbal $db, phpbb_cache_driver_interface $cache, $table)
+ public function __construct(phpbb_db_driver $db, phpbb_cache_driver_interface $cache, $table)
{
$this->db = $db;
$this->cache = $cache;
diff --git a/phpBB/includes/cron/task/core/prune_all_forums.php b/phpBB/includes/cron/task/core/prune_all_forums.php
index ee0b5f7626..26e7528035 100644
--- a/phpBB/includes/cron/task/core/prune_all_forums.php
+++ b/phpBB/includes/cron/task/core/prune_all_forums.php
@@ -39,7 +39,7 @@ class phpbb_cron_task_core_prune_all_forums extends phpbb_cron_task_base
* @param phpbb_config $config The config
* @param dbal $db The db connection
*/
- public function __construct($phpbb_root_path, $php_ext, phpbb_config $config, dbal $db)
+ public function __construct($phpbb_root_path, $php_ext, phpbb_config $config, phpbb_db_driver $db)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
diff --git a/phpBB/includes/cron/task/core/prune_forum.php b/phpBB/includes/cron/task/core/prune_forum.php
index fa7a761d88..9861d8b0c6 100644
--- a/phpBB/includes/cron/task/core/prune_forum.php
+++ b/phpBB/includes/cron/task/core/prune_forum.php
@@ -49,7 +49,7 @@ class phpbb_cron_task_core_prune_forum extends phpbb_cron_task_base implements p
* @param phpbb_config $config The config
* @param dbal $db The db connection
*/
- public function __construct($phpbb_root_path, $php_ext, phpbb_config $config, dbal $db)
+ public function __construct($phpbb_root_path, $php_ext, phpbb_config $config, phpbb_db_driver $db)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
diff --git a/phpBB/includes/cron/task/core/tidy_search.php b/phpBB/includes/cron/task/core/tidy_search.php
index fdbe31346e..169fd3ba73 100644
--- a/phpBB/includes/cron/task/core/tidy_search.php
+++ b/phpBB/includes/cron/task/core/tidy_search.php
@@ -41,7 +41,7 @@ class phpbb_cron_task_core_tidy_search extends phpbb_cron_task_base
* @param dbal $db The db connection
* @param phpbb_user $user The user
*/
- public function __construct($phpbb_root_path, $php_ext, phpbb_auth $auth, phpbb_config $config, dbal $db, phpbb_user $user)
+ public function __construct($phpbb_root_path, $php_ext, phpbb_auth $auth, phpbb_config $config, phpbb_db_driver $db, phpbb_user $user)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php
index 6df3aac9ce..2bb016cebd 100644
--- a/phpBB/includes/db/db_tools.php
+++ b/phpBB/includes/db/db_tools.php
@@ -300,7 +300,7 @@ class phpbb_db_tools
/**
* Constructor. Set DB Object and set {@link $return_statements return_statements}.
*
- * @param phpbb_dbal $db DBAL object
+ * @param phpbb_db_driver $db Database connection
* @param bool $return_statements True if only statements should be returned and no SQL being executed
*/
function phpbb_db_tools(&$db, $return_statements = false)
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/driver/driver.php
index ef1dd7d14d..25daa7243d 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/driver/driver.php
@@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
* Database Abstraction Layer
* @package dbal
*/
-class dbal
+class phpbb_db_driver
{
var $db_connect_id;
var $query_result;
@@ -72,17 +72,17 @@ class dbal
/**
* Constructor
*/
- function dbal()
+ function __construct()
{
$this->num_queries = array(
- 'cached' => 0,
- 'normal' => 0,
- 'total' => 0,
+ 'cached' => 0,
+ 'normal' => 0,
+ 'total' => 0,
);
// Fill default sql layer based on the class being called.
// This can be changed by the specified layer itself later if needed.
- $this->sql_layer = substr(get_class($this), 5);
+ $this->sql_layer = substr(get_class($this), strlen('phpbb_db_driver_'));
// Do not change this please! This variable is used to easy the use of it - and is hardcoded.
$this->any_char = chr(0) . '%';
@@ -1042,8 +1042,3 @@ class dbal
return $rows_total;
}
}
-
-/**
-* This variable holds the class name to use later
-*/
-$sql_db = (!empty($dbms)) ? 'dbal_' . basename($dbms) : 'dbal';
diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/driver/firebird.php
index 5728eb901c..a55175c345 100644
--- a/phpBB/includes/db/firebird.php
+++ b/phpBB/includes/db/driver/firebird.php
@@ -15,14 +15,12 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
/**
* Firebird/Interbase Database Abstraction Layer
* Minimum Requirement is Firebird 2.1
* @package dbal
*/
-class dbal_firebird extends dbal
+class phpbb_db_driver_firebird extends phpbb_db_driver
{
var $last_query_text = '';
var $service_handle = false;
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/driver/mssql.php
index 235c48d3f0..ac957e7698 100644
--- a/phpBB/includes/db/mssql.php
+++ b/phpBB/includes/db/driver/mssql.php
@@ -15,14 +15,12 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
/**
* MSSQL Database Abstraction Layer
* Minimum Requirement is MSSQL 2000+
* @package dbal
*/
-class dbal_mssql extends dbal
+class phpbb_db_driver_mssql extends phpbb_db_driver
{
var $connect_error = '';
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/driver/mssql_odbc.php
index 2194de4a5e..13e74e66d4 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/driver/mssql_odbc.php
@@ -15,8 +15,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
/**
* Unified ODBC functions
* Unified ODBC functions support any database having ODBC driver, for example Adabas D, IBM DB2, iODBC, Solid, Sybase SQL Anywhere...
@@ -28,7 +26,7 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
*
* @package dbal
*/
-class dbal_mssql_odbc extends dbal
+class phpbb_db_driver_mssql_odbc extends phpbb_db_driver
{
var $last_query_text = '';
var $connect_error = '';
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/driver/mssqlnative.php
index 4a969828e7..4b1639aba2 100644
--- a/phpBB/includes/db/mssqlnative.php
+++ b/phpBB/includes/db/driver/mssqlnative.php
@@ -19,8 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
/**
* Prior to version 1.1 the SQL Server Native PHP driver didn't support sqlsrv_num_rows, or cursor based seeking so we recall all rows into an array
* and maintain our own cursor index into that array.
@@ -193,7 +191,7 @@ class result_mssqlnative
/**
* @package dbal
*/
-class dbal_mssqlnative extends dbal
+class phpbb_db_driver_mssqlnative extends phpbb_db_driver
{
var $m_insert_id = NULL;
var $last_query_text = '';
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/driver/mysql.php
index dcdeec0401..6fc6fab483 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/driver/mysql.php
@@ -15,8 +15,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
/**
* MySQL4 Database Abstraction Layer
* Compatible with:
@@ -26,7 +24,7 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
* MySQL 5.0+
* @package dbal
*/
-class dbal_mysql extends dbal
+class phpbb_db_driver_mysql extends phpbb_db_driver
{
var $multi_insert = true;
var $connect_error = '';
diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/driver/mysqli.php
index 5713b1992c..be28a95715 100644
--- a/phpBB/includes/db/mysqli.php
+++ b/phpBB/includes/db/driver/mysqli.php
@@ -15,15 +15,13 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
/**
* MySQLi Database Abstraction Layer
* mysqli-extension has to be compiled with:
* MySQL 4.1+ or MySQL 5.0+
* @package dbal
*/
-class dbal_mysqli extends dbal
+class phpbb_db_driver_mysqli extends phpbb_db_driver
{
var $multi_insert = true;
var $connect_error = '';
diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/driver/oracle.php
index 4a2b107865..6263ea8414 100644
--- a/phpBB/includes/db/oracle.php
+++ b/phpBB/includes/db/driver/oracle.php
@@ -15,13 +15,11 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
/**
* Oracle Database Abstraction Layer
* @package dbal
*/
-class dbal_oracle extends dbal
+class phpbb_db_driver_oracle extends phpbb_db_driver
{
var $last_query_text = '';
var $connect_error = '';
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/driver/postgres.php
index 8dfbfc3b60..147ecd04d9 100644
--- a/phpBB/includes/db/postgres.php
+++ b/phpBB/includes/db/driver/postgres.php
@@ -15,19 +15,12 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
-if (!class_exists('phpbb_error_collector'))
-{
- include($phpbb_root_path . 'includes/error_collector.' . $phpEx);
-}
-
/**
* PostgreSQL Database Abstraction Layer
* Minimum Requirement is Version 7.3+
* @package dbal
*/
-class dbal_postgres extends dbal
+class phpbb_db_driver_postgres extends phpbb_db_driver
{
var $last_query_text = '';
var $connect_error = '';
diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/driver/sqlite.php
index 06e368d586..6b9cc64d89 100644
--- a/phpBB/includes/db/sqlite.php
+++ b/phpBB/includes/db/driver/sqlite.php
@@ -15,14 +15,12 @@ if (!defined('IN_PHPBB'))
exit;
}
-include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
-
/**
* Sqlite Database Abstraction Layer
* Minimum Requirement: 2.8.2+
* @package dbal
*/
-class dbal_sqlite extends dbal
+class phpbb_db_driver_sqlite extends phpbb_db_driver
{
var $connect_error = '';
diff --git a/phpBB/includes/di/extension/config.php b/phpBB/includes/di/extension/config.php
index fb5ca90070..97a6290066 100644
--- a/phpBB/includes/di/extension/config.php
+++ b/phpBB/includes/di/extension/config.php
@@ -43,8 +43,8 @@ class phpbb_di_extension_config extends Extension
require($this->config_file);
$container->setParameter('core.table_prefix', $table_prefix);
- $container->setParameter('cache.driver.class', $this->fix_acm_type($acm_type));
- $container->setParameter('dbal.driver.class', 'dbal_'.$dbms);
+ $container->setParameter('cache.driver.class', $this->convert_30_acm_type($acm_type));
+ $container->setParameter('dbal.driver.class', phpbb_convert_30_dbms_to_31($dbms));
$container->setParameter('dbal.dbhost', $dbhost);
$container->setParameter('dbal.dbuser', $dbuser);
$container->setParameter('dbal.dbpasswd', $dbpasswd);
@@ -66,12 +66,12 @@ class phpbb_di_extension_config extends Extension
}
/**
- * Convert old (3.0) values to 3.1 class names
+ * Convert 3.0 ACM type to 3.1 cache driver class name
*
- * @param style $acm_type ACM type
- * @return ACM type class
+ * @param string $acm_type ACM type
+ * @return cache driver class
*/
- protected function fix_acm_type($acm_type)
+ protected function convert_30_acm_type($acm_type)
{
if (preg_match('#^[a-z]+$#', $acm_type))
{
diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php
index bfd4edde93..67cc81e407 100644
--- a/phpBB/includes/extension/manager.php
+++ b/phpBB/includes/extension/manager.php
@@ -34,7 +34,7 @@ class phpbb_extension_manager
/**
* Creates a manager and loads information from database
*
- * @param dbal $db A database connection
+ * @param phpbb_db_driver $db A database connection
* @param phpbb_config $config phpbb_config
* @param string $extension_table The name of the table holding extensions
* @param string $phpbb_root_path Path to the phpbb includes directory.
@@ -42,7 +42,7 @@ class phpbb_extension_manager
* @param phpbb_cache_driver_interface $cache A cache instance or null
* @param string $cache_name The name of the cache variable, defaults to _ext
*/
- public function __construct(dbal $db, phpbb_config $config, $extension_table, $phpbb_root_path, $php_ext = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext')
+ public function __construct(phpbb_db_driver $db, phpbb_config $config, $extension_table, $phpbb_root_path, $php_ext = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext')
{
$this->phpbb_root_path = $phpbb_root_path;
$this->db = $db;
diff --git a/phpBB/includes/extension/metadata_manager.php b/phpBB/includes/extension/metadata_manager.php
index ea85bd3c4e..36b0f8b184 100644
--- a/phpBB/includes/extension/metadata_manager.php
+++ b/phpBB/includes/extension/metadata_manager.php
@@ -34,12 +34,12 @@ class phpbb_extension_metadata_manager
/**
* Creates the metadata manager
*
- * @param dbal $db A database connection
+ * @param phpbb_db_driver $db A database connection
* @param string $extension_manager An instance of the phpbb extension manager
* @param string $phpbb_root_path Path to the phpbb includes directory.
* @param string $phpEx php file extension
*/
- public function __construct($ext_name, dbal $db, phpbb_extension_manager $extension_manager, $phpbb_root_path, $phpEx = '.php', phpbb_template $template, phpbb_config $config)
+ public function __construct($ext_name, phpbb_db_driver $db, phpbb_extension_manager $extension_manager, $phpbb_root_path, $phpEx = '.php', phpbb_template $template, phpbb_config $config)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->db = $db;
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index e492f97022..4bf991ca9e 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -5550,6 +5550,27 @@ function phpbb_to_numeric($input)
}
/**
+* Convert 3.0 dbms to 3.1 db driver class name
+*
+* @param string $dbms dbms parameter
+* @return db driver class
+*/
+function phpbb_convert_30_dbms_to_31($dbms)
+{
+ if (class_exists($dbms))
+ {
+ return $dbms;
+ }
+
+ if (class_exists('phpbb_db_driver_' . $dbms))
+ {
+ return 'phpbb_db_driver_' . $dbms;
+ }
+
+ throw new \RuntimeException("You have specified an invalid dbms driver: $dbms");
+}
+
+/**
* Create a Symfony Request object from phpbb_request object
*
* @param phpbb_request $request Request object
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index fc6f1cc762..9ae647d806 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -596,7 +596,7 @@ function phpbb_parse_range_request($request_array, $filesize)
/**
* Increments the download count of all provided attachments
*
-* @param dbal $db The database object
+* @param phpbb_db_driver $db The database object
* @param array|int $ids The attach_id of each attachment
*
* @return null
@@ -617,7 +617,7 @@ function phpbb_increment_downloads($db, $ids)
/**
* Handles authentication when downloading attachments from a post or topic
*
-* @param dbal $db The database object
+* @param phpbb_db_driver $db The database object
* @param phpbb_auth $auth The authentication object
* @param int $topic_id The id of the topic that we are downloading from
*
@@ -651,7 +651,7 @@ function phpbb_download_handle_forum_auth($db, $auth, $topic_id)
/**
* Handles authentication when downloading attachments from PMs
*
-* @param dbal $db The database object
+* @param phpbb_db_driver $db The database object
* @param phpbb_auth $auth The authentication object
* @param int $user_id The user id
* @param int $msg_id The id of the PM that we are downloading from
@@ -678,7 +678,7 @@ function phpbb_download_handle_pm_auth($db, $auth, $user_id, $msg_id)
/**
* Checks whether a user can download from a particular PM
*
-* @param dbal $db The database object
+* @param phpbb_db_driver $db The database object
* @param int $user_id The user id
* @param int $msg_id The id of the PM that we are downloading from
*
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index ab6b3ea009..2b4b7eb10d 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -28,7 +28,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'firebird',
'MODULE' => 'interbase',
'DELIM' => ';;',
- 'DRIVER' => 'firebird',
+ 'DRIVER' => 'phpbb_db_driver_firebird',
'AVAILABLE' => true,
'2.0.x' => false,
),
@@ -37,7 +37,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mysql_41',
'MODULE' => 'mysqli',
'DELIM' => ';',
- 'DRIVER' => 'mysqli',
+ 'DRIVER' => 'phpbb_db_driver_mysqli',
'AVAILABLE' => true,
'2.0.x' => true,
),
@@ -46,7 +46,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mysql',
'MODULE' => 'mysql',
'DELIM' => ';',
- 'DRIVER' => 'mysql',
+ 'DRIVER' => 'phpbb_db_driver_mysql',
'AVAILABLE' => true,
'2.0.x' => true,
),
@@ -55,7 +55,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mssql',
'MODULE' => 'mssql',
'DELIM' => 'GO',
- 'DRIVER' => 'mssql',
+ 'DRIVER' => 'phpbb_db_driver_mssql',
'AVAILABLE' => true,
'2.0.x' => true,
),
@@ -64,7 +64,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mssql',
'MODULE' => 'odbc',
'DELIM' => 'GO',
- 'DRIVER' => 'mssql_odbc',
+ 'DRIVER' => 'phpbb_db_driver_mssql_odbc',
'AVAILABLE' => true,
'2.0.x' => true,
),
@@ -73,7 +73,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mssql',
'MODULE' => 'sqlsrv',
'DELIM' => 'GO',
- 'DRIVER' => 'mssqlnative',
+ 'DRIVER' => 'phpbb_db_driver_mssqlnative',
'AVAILABLE' => true,
'2.0.x' => false,
),
@@ -82,7 +82,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'oracle',
'MODULE' => 'oci8',
'DELIM' => '/',
- 'DRIVER' => 'oracle',
+ 'DRIVER' => 'phpbb_db_driver_oracle',
'AVAILABLE' => true,
'2.0.x' => false,
),
@@ -91,7 +91,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'postgres',
'MODULE' => 'pgsql',
'DELIM' => ';',
- 'DRIVER' => 'postgres',
+ 'DRIVER' => 'phpbb_db_driver_postgres',
'AVAILABLE' => true,
'2.0.x' => true,
),
@@ -100,7 +100,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'sqlite',
'MODULE' => 'sqlite',
'DELIM' => ';',
- 'DRIVER' => 'sqlite',
+ 'DRIVER' => 'phpbb_db_driver_sqlite',
'AVAILABLE' => true,
'2.0.x' => false,
),
@@ -205,26 +205,19 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
$dbms = $dbms_details['DRIVER'];
- if ($load_dbal)
- {
- // Include the DB layer
- include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
- }
-
// Instantiate it and set return on error true
- $sql_db = 'dbal_' . $dbms;
- $db = new $sql_db();
+ $db = new $dbms();
$db->sql_return_on_error(true);
// Check that we actually have a database name before going any further.....
- if ($dbms_details['DRIVER'] != 'sqlite' && $dbms_details['DRIVER'] != 'oracle' && $dbname === '')
+ if ($dbms_details['DRIVER'] != 'phpbb_db_driver_sqlite' && $dbms_details['DRIVER'] != 'phpbb_db_driver_oracle' && $dbname === '')
{
$error[] = $lang['INST_ERR_DB_NO_NAME'];
return false;
}
// Make sure we don't have a daft user who thinks having the SQLite database in the forum directory is a good idea
- if ($dbms_details['DRIVER'] == 'sqlite' && stripos(phpbb_realpath($dbhost), phpbb_realpath('../')) === 0)
+ if ($dbms_details['DRIVER'] == 'phpbb_db_driver_sqlite' && stripos(phpbb_realpath($dbhost), phpbb_realpath('../')) === 0)
{
$error[] = $lang['INST_ERR_DB_FORUM_PATH'];
return false;
@@ -233,8 +226,8 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
// Check the prefix length to ensure that index names are not too long and does not contain invalid characters
switch ($dbms_details['DRIVER'])
{
- case 'mysql':
- case 'mysqli':
+ case 'phpbb_db_driver_mysql':
+ case 'phpbb_db_driver_mysqli':
if (strspn($table_prefix, '-./\\') !== 0)
{
$error[] = $lang['INST_ERR_PREFIX_INVALID'];
@@ -243,22 +236,22 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
// no break;
- case 'postgres':
+ case 'phpbb_db_driver_postgres':
$prefix_length = 36;
break;
- case 'mssql':
- case 'mssql_odbc':
- case 'mssqlnative':
+ case 'phpbb_db_driver_mssql':
+ case 'phpbb_db_driver_mssql_odbc':
+ case 'phpbb_db_driver_mssqlnative':
$prefix_length = 90;
break;
- case 'sqlite':
+ case 'phpbb_db_driver_sqlite':
$prefix_length = 200;
break;
- case 'firebird':
- case 'oracle':
+ case 'phpbb_db_driver_firebird':
+ case 'phpbb_db_driver_oracle':
$prefix_length = 6;
break;
}
@@ -296,21 +289,21 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
// Make sure that the user has selected a sensible DBAL for the DBMS actually installed
switch ($dbms_details['DRIVER'])
{
- case 'mysqli':
+ case 'phpbb_db_driver_mysqli':
if (version_compare(mysqli_get_server_info($db->db_connect_id), '4.1.3', '<'))
{
$error[] = $lang['INST_ERR_DB_NO_MYSQLI'];
}
break;
- case 'sqlite':
+ case 'phpbb_db_driver_sqlite':
if (version_compare(sqlite_libversion(), '2.8.2', '<'))
{
$error[] = $lang['INST_ERR_DB_NO_SQLITE'];
}
break;
- case 'firebird':
+ case 'phpbb_db_driver_firebird':
// check the version of FB, use some hackery if we can't get access to the server info
if ($db->service_handle !== false && function_exists('ibase_server_info'))
{
@@ -391,7 +384,7 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
}
break;
- case 'oracle':
+ case 'phpbb_db_driver_oracle':
if ($unicode_check)
{
$sql = "SELECT *
@@ -413,7 +406,7 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
}
break;
- case 'postgres':
+ case 'phpbb_db_driver_postgres':
if ($unicode_check)
{
$sql = "SHOW server_encoding;";
diff --git a/phpBB/includes/lock/db.php b/phpBB/includes/lock/db.php
index 6e94dd5a85..ccdaed0b28 100644
--- a/phpBB/includes/lock/db.php
+++ b/phpBB/includes/lock/db.php
@@ -48,7 +48,7 @@ class phpbb_lock_db
/**
* A database connection
- * @var dbal
+ * @var phpbb_db_driver
*/
private $db;
@@ -59,9 +59,9 @@ class phpbb_lock_db
*
* @param string $config_name A config variable to be used for locking
* @param array $config The phpBB configuration
- * @param dbal $db A database connection
+ * @param phpbb_db_driver $db A database connection
*/
- public function __construct($config_name, phpbb_config $config, dbal $db)
+ public function __construct($config_name, phpbb_config $config, phpbb_db_driver $db)
{
$this->config_name = $config_name;
$this->config = $config;
diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php
index 2d29fe978e..6f2727a38c 100644
--- a/phpBB/includes/questionnaire/questionnaire.php
+++ b/phpBB/includes/questionnaire/questionnaire.php
@@ -260,6 +260,8 @@ class phpbb_questionnaire_phpbb_data_provider
include("{$phpbb_root_path}config.$phpEx");
unset($dbhost, $dbport, $dbname, $dbuser, $dbpasswd); // Just a precaution
+ $dbms = phpbb_convert_30_dbms_to_31($dbms);
+
// Only send certain config vars
$config_vars = array(
'active_sessions' => true,
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
index ff2e24aa05..324c214e91 100644
--- a/phpBB/includes/search/fulltext_mysql.php
+++ b/phpBB/includes/search/fulltext_mysql.php
@@ -41,8 +41,8 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
protected $config;
/**
- * DBAL object
- * @var dbal
+ * Database connection
+ * @var phpbb_db_driver
*/
protected $db;
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php
index 4623326fc7..53df8348ae 100644
--- a/phpBB/includes/search/fulltext_native.php
+++ b/phpBB/includes/search/fulltext_native.php
@@ -85,8 +85,8 @@ class phpbb_search_fulltext_native extends phpbb_search_base
protected $config;
/**
- * DBAL object
- * @var dbal
+ * Database connection
+ * @var phpbb_db_driver
*/
protected $db;
diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php
index 2880610655..f22ee2ca16 100644
--- a/phpBB/includes/search/fulltext_postgres.php
+++ b/phpBB/includes/search/fulltext_postgres.php
@@ -66,8 +66,8 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
protected $config;
/**
- * DBAL object
- * @var dbal
+ * Database connection
+ * @var phpbb_db_driver
*/
protected $db;
diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php
index dd5634b623..a84a64825c 100644
--- a/phpBB/includes/search/fulltext_sphinx.php
+++ b/phpBB/includes/search/fulltext_sphinx.php
@@ -84,8 +84,8 @@ class phpbb_search_fulltext_sphinx
protected $config;
/**
- * DBAL object
- * @var dbal
+ * Database connection
+ * @var phpbb_db_driver
*/
protected $db;