1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 14:30:32 +02:00

[ticket/16741] Fix tests

PHPBB3-16741
This commit is contained in:
Máté Bartus
2021-12-05 11:25:56 +01:00
parent a0584b8677
commit e93c914da3
2 changed files with 23 additions and 16 deletions

View File

@@ -116,6 +116,11 @@ class container_builder
*/
private $env_parameters = [];
/**
* @var \phpbb\db\driver\driver_interface
*/
protected $dbal_connection = null;
/**
* Constructor
*
@@ -568,20 +573,22 @@ class container_builder
$config_data = $this->config_php_file->get_all();
if (!empty($config_data))
{
$dbal_driver_class = \phpbb\config_php_file::convert_30_dbms_to_31($this->config_php_file->get('dbms'));
/** @var \phpbb\db\driver\driver_interface $dbal_connection */
$dbal_connection = new $dbal_driver_class();
$dbal_connection->sql_connect(
$this->config_php_file->get('dbhost'),
$this->config_php_file->get('dbuser'),
$this->config_php_file->get('dbpasswd'),
$this->config_php_file->get('dbname'),
$this->config_php_file->get('dbport'),
false,
defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK
);
//$this->dbal_connection_doctrine = connection_factory::get_connection($this->config_php_file);
$this->container->set('dbal.conn.driver', $dbal_connection);
if ($this->dbal_connection === null)
{
$dbal_driver_class = \phpbb\config_php_file::convert_30_dbms_to_31($this->config_php_file->get('dbms'));
/** @var \phpbb\db\driver\driver_interface $dbal_connection */
$this->dbal_connection = new $dbal_driver_class();
$this->dbal_connection->sql_connect(
$this->config_php_file->get('dbhost'),
$this->config_php_file->get('dbuser'),
$this->config_php_file->get('dbpasswd'),
$this->config_php_file->get('dbname'),
$this->config_php_file->get('dbport'),
false,
defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK
);
}
$this->container->set('dbal.conn.driver', $this->dbal_connection);
}
}