aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/develop/create_schema_files.php5
-rw-r--r--phpBB/develop/mysql_upgrader.php5
-rw-r--r--phpBB/includes/acp/acp_database.php6
-rw-r--r--phpBB/includes/functions_install.php3
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php4
-rw-r--r--phpBB/install/install_install.php7
-rw-r--r--phpBB/phpbb/captcha/plugins/qa.php12
-rw-r--r--phpBB/phpbb/search/fulltext_sphinx.php3
8 files changed, 28 insertions, 17 deletions
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index 5c5bfe6171..8dce97144d 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -49,7 +49,10 @@ $classes = $finder->core_path('phpbb/')
->get_classes();
$db = new \phpbb\db\driver\sqlite();
-$schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $db, new \phpbb\db\tools\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
+$factory = new \phpbb\db\tools\factory();
+$db_tools = $factory->get($db, true);
+
+$schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $db, $db_tools, $phpbb_root_path, $phpEx, $table_prefix);
$schema_data = $schema_generator->get_schema();
$fp = fopen($schema_path . 'schema.json', 'wb');
diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php
index 51fbd75c10..543b520caa 100644
--- a/phpBB/develop/mysql_upgrader.php
+++ b/phpBB/develop/mysql_upgrader.php
@@ -67,7 +67,10 @@ $classes = $finder->core_path('phpbb/')
->directory('/db/migration/data')
->get_classes();
-$schema_generator = new \phpbb\db\migration\schema_generator($classes, $config, $db, new \phpbb\db\tools\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
+$factory = new \phpbb\db\tools\factory();
+$db_tools = $factory->get($db, true);
+
+$schema_generator = new \phpbb\db\migration\schema_generator($classes, $config, $db, $db_tools, $phpbb_root_path, $phpEx, $table_prefix);
$schema_data = $schema_generator->get_schema();
$dbms_type_map = \phpbb\db\tools\tools::get_dbms_type_map();
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index fb02e58b13..25cddaa5d4 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -26,10 +26,10 @@ class acp_database
function main($id, $mode)
{
- global $cache, $db, $user, $auth, $template, $table_prefix, $request;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_log;
+ global $cache, $db, $user, $template, $table_prefix, $request;
+ global $phpbb_root_path, $phpbb_container, $phpbb_log;
- $this->db_tools = new \phpbb\db\tools\tools($db);
+ $this->db_tools = $phpbb_container->get('dbal.tools');
$user->add_lang('acp/database');
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index 956e5a5180..4217617b53 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -188,7 +188,8 @@ function dbms_select($default = '', $only_20x_options = false)
*/
function get_tables(&$db)
{
- $db_tools = new \phpbb\db\tools\tools($db);
+ $factory = new \phpbb\db\tools\factory();
+ $db_tools = $factory->get($db);
return $db_tools->sql_list_tables();
}
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index f8a6954634..48cff426b8 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -1926,7 +1926,9 @@ function phpbb_check_username_collisions()
function phpbb_convert_timezone($timezone)
{
global $config, $db, $phpbb_root_path, $phpEx, $table_prefix;
- $timezone_migration = new \phpbb\db\migration\data\v310\timezone($config, $db, new \phpbb\db\tools\tools($db), $phpbb_root_path, $phpEx, $table_prefix);
+
+ $factory = new \phpbb\db\tools\factory();
+ $timezone_migration = new \phpbb\db\migration\data\v310\timezone($config, $db, $factory->get($db), $phpbb_root_path, $phpEx, $table_prefix);
return $timezone_migration->convert_phpbb30_timezone($timezone, 0);
}
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 380f34bab6..e38c9c5bdf 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -1200,7 +1200,9 @@ class install_install extends module
->get_classes();
$sqlite_db = new \phpbb\db\driver\sqlite();
- $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $sqlite_db, new \phpbb\db\tools\tools($sqlite_db, true), $phpbb_root_path, $phpEx, $table_prefix);
+ $factory = new \phpbb\db\tools\factory();
+ $db_tools = $factory->get($sqlite_db, true);
+ $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $sqlite_db, $db_tools, $phpbb_root_path, $phpEx, $table_prefix);
$db_table_schema = $schema_generator->get_schema();
}
@@ -1212,7 +1214,8 @@ class install_install extends module
define('CONFIG_TABLE', $data['table_prefix'] . 'config');
}
- $db_tools = new \phpbb\db\tools\tools($db);
+ $factory = new \phpbb\db\tools\factory();
+ $db_tools = $factory->get($db);
foreach ($db_table_schema as $table_name => $table_data)
{
$db_tools->sql_create_table(
diff --git a/phpBB/phpbb/captcha/plugins/qa.php b/phpBB/phpbb/captcha/plugins/qa.php
index b4586f1234..cf03f92e96 100644
--- a/phpBB/phpbb/captcha/plugins/qa.php
+++ b/phpBB/phpbb/captcha/plugins/qa.php
@@ -113,9 +113,9 @@ class qa
*/
public function is_installed()
{
- global $db;
+ global $phpbb_container;
- $db_tool = new \phpbb\db\tools\tools($db);
+ $db_tool = $phpbb_container->get('dbal.tools');
return $db_tool->sql_table_exists($this->table_captcha_questions);
}
@@ -306,11 +306,9 @@ class qa
*/
function install()
{
- global $db;
-
- $db_tool = new \phpbb\db\tools\tools($db);
+ global $phpbb_container;
- $tables = array($this->table_captcha_questions, $this->table_captcha_answers, $this->table_qa_confirm);
+ $db_tool = $phpbb_container->get('dbal.tools');
$schemas = array(
$this->table_captcha_questions => array (
@@ -352,7 +350,7 @@ class qa
),
);
- foreach($schemas as $table => $schema)
+ foreach ($schemas as $table => $schema)
{
if (!$db_tool->sql_table_exists($table))
{
diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php
index 0be646ff06..a5ad96b114 100644
--- a/phpBB/phpbb/search/fulltext_sphinx.php
+++ b/phpBB/phpbb/search/fulltext_sphinx.php
@@ -136,7 +136,8 @@ class fulltext_sphinx
$this->auth = $auth;
// Initialize \phpbb\db\tools\tools object
- $this->db_tools = new \phpbb\db\tools\tools($this->db);
+ global $phpbb_container; // TODO inject into object
+ $this->db_tools = $phpbb_container->get('dbal.tools');
if(!$this->config['fulltext_sphinx_id'])
{