1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/16741] General fixes

PHPBB3-16741
This commit is contained in:
Tristan Darricau
2021-11-09 02:48:34 +01:00
parent 300e5399f5
commit 6ce708539b
20 changed files with 941 additions and 385 deletions

View File

@@ -13,6 +13,7 @@
namespace phpbb\install\helper;
use phpbb\db\doctrine\connection_factory;
use phpbb\install\exception\invalid_dbms_exception;
use phpbb\filesystem\helper as filesystem_helper;
@@ -389,8 +390,9 @@ class database
$temp_prefix . 'users',
);
$doctrine_db = connection_factory::get_connection_from_params($dbms, $dbhost, $dbuser, $dbpass, $dbname, $dbport);
$db_tools_factory = new \phpbb\db\tools\factory();
$db_tools = $db_tools_factory->get($db);
$db_tools = $db_tools_factory->get($doctrine_db);
$tables = $db_tools->sql_list_tables();
$tables = array_map('strtolower', $tables);
$table_intersect = array_intersect($tables, $table_ary);

View File

@@ -13,6 +13,7 @@
namespace phpbb\install\module\install_database\task;
use phpbb\db\doctrine\connection_factory;
use phpbb\db\driver\driver_interface;
use phpbb\db\tools\tools_interface;
use phpbb\install\helper\config;
@@ -83,8 +84,17 @@ class add_tables extends task_base
false
);
$doctrine_db = connection_factory::get_connection_from_params(
$config->get('dbms'),
$config->get('dbhost'),
$config->get('dbuser'),
$config->get('dbpasswd'),
$config->get('dbname'),
$config->get('dbport')
);
$this->config = $config;
$this->db_tools = $factory->get($this->db);
$this->db_tools = $factory->get($doctrine_db);
$this->schema_file_path = $phpbb_root_path . 'store/schema.json';
$this->table_prefix = $this->config->get('table_prefix');
$this->change_prefix = $this->config->get('change_table_prefix', true);

View File

@@ -13,6 +13,7 @@
namespace phpbb\install\module\install_database\task;
use phpbb\db\doctrine\connection_factory;
use phpbb\install\exception\resource_limit_reached_exception;
/**
@@ -30,6 +31,11 @@ class create_schema_file extends \phpbb\install\task_base
*/
protected $db;
/**
* @var \Doctrine\DBAL\Connection
*/
protected $db_doctrine;
/**
* @var \phpbb\filesystem\filesystem_interface
*/
@@ -81,6 +87,15 @@ class create_schema_file extends \phpbb\install\task_base
false
);
$this->db_doctrine = connection_factory::get_connection_from_params(
$config->get('dbms'),
$config->get('dbhost'),
$config->get('dbuser'),
$config->get('dbpasswd'),
$config->get('dbname'),
$config->get('dbport')
);
$this->config = $config;
$this->filesystem = $filesystem;
$this->phpbb_root_path = $phpbb_root_path;
@@ -129,7 +144,7 @@ class create_schema_file extends \phpbb\install\task_base
$finder = $finder_factory->get();
$migrator_classes = $finder->core_path('phpbb/db/migration/data/')->get_classes();
$factory = new \phpbb\db\tools\factory();
$db_tools = $factory->get($this->db, true);
$db_tools = $factory->get($this->db_doctrine, true);
$tables_data = \Symfony\Component\Yaml\Yaml::parseFile($this->phpbb_root_path . '/config/default/container/tables.yml');
$tables = [];
foreach ($tables_data['parameters'] as $parameter => $table)