mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-09 11:38:52 +00:00
[ticket/17525] Provide Doctrine connection via dbtools
PHPBB-17525
This commit is contained in:
parent
1cadb3818a
commit
4274faa715
3 changed files with 9 additions and 7 deletions
|
@ -90,7 +90,7 @@ class rename_duplicated_index_names extends migration
|
||||||
public function get_tables_index_names()
|
public function get_tables_index_names()
|
||||||
{
|
{
|
||||||
$table_keys = [];
|
$table_keys = [];
|
||||||
$schema_manager = $this->db_doctrine->createSchemaManager();
|
$schema_manager = $this->db_tools->get_connection()->createSchemaManager();
|
||||||
$table_names = $schema_manager->listTableNames();
|
$table_names = $schema_manager->listTableNames();
|
||||||
|
|
||||||
if (!empty($table_names))
|
if (!empty($table_names))
|
||||||
|
|
|
@ -28,9 +28,6 @@ abstract class migration implements migration_interface
|
||||||
/** @var \phpbb\db\driver\driver_interface */
|
/** @var \phpbb\db\driver\driver_interface */
|
||||||
protected $db;
|
protected $db;
|
||||||
|
|
||||||
/** @var \Doctrine\DBAL\Connection */
|
|
||||||
protected $db_doctrine;
|
|
||||||
|
|
||||||
/** @var \phpbb\db\tools\tools_interface */
|
/** @var \phpbb\db\tools\tools_interface */
|
||||||
protected $db_tools;
|
protected $db_tools;
|
||||||
|
|
||||||
|
@ -75,9 +72,6 @@ abstract class migration implements migration_interface
|
||||||
$this->php_ext = $php_ext;
|
$this->php_ext = $php_ext;
|
||||||
|
|
||||||
$this->errors = array();
|
$this->errors = array();
|
||||||
|
|
||||||
$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $php_ext);
|
|
||||||
$this->db_doctrine = \phpbb\db\doctrine\connection_factory::get_connection($phpbb_config_php_file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -61,6 +61,14 @@ class doctrine implements tools_interface
|
||||||
$this->connection = $connection;
|
$this->connection = $connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Connection
|
||||||
|
*/
|
||||||
|
public function get_connection(): Connection
|
||||||
|
{
|
||||||
|
return $this->connection;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return AbstractSchemaManager
|
* @return AbstractSchemaManager
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue