mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 03:34:04 +02:00
[ticket/11015] Make DBAL classes autoloadable
PHPBB3-11015 This allows us to just create the object without having to include the driver first. However, it also means that users must specify the full class name in config.php
This commit is contained in:
@@ -87,12 +87,8 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
// so we don't reopen an open connection
|
||||
if (!($this->db instanceof dbal))
|
||||
{
|
||||
if (!class_exists('dbal_' . self::$config['dbms']))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/db/' . self::$config['dbms'] . ".$phpEx");
|
||||
}
|
||||
$sql_db = 'dbal_' . self::$config['dbms'];
|
||||
$this->db = new $sql_db();
|
||||
$dbms = self::$config['dbms'];
|
||||
$this->db = new $dbms();
|
||||
$this->db->sql_connect(self::$config['dbhost'], self::$config['dbuser'], self::$config['dbpasswd'], self::$config['dbname'], self::$config['dbport']);
|
||||
}
|
||||
return $this->db;
|
||||
|
Reference in New Issue
Block a user