mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-09 18:26:32 +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:
@@ -33,7 +33,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
|
||||
$db_config = $this->get_database_config();
|
||||
|
||||
// Firebird requires table and column names to be uppercase
|
||||
if ($db_config['dbms'] == 'firebird')
|
||||
if ($db_config['dbms'] == 'phpbb_db_driver_firebird')
|
||||
{
|
||||
$xml_data = file_get_contents($path);
|
||||
$xml_data = preg_replace_callback('/(?:(<table name="))([a-z_]+)(?:(">))/', 'phpbb_database_test_case::to_upper', $xml_data);
|
||||
@@ -100,9 +100,8 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
|
||||
|
||||
$config = $this->get_database_config();
|
||||
|
||||
require_once dirname(__FILE__) . '/../../phpBB/includes/db/' . $config['dbms'] . '.php';
|
||||
$dbal = 'dbal_' . $config['dbms'];
|
||||
$db = new $dbal();
|
||||
$dbms = $config['dbms'];
|
||||
$db = new $dbms();
|
||||
$db->sql_connect($config['dbhost'], $config['dbuser'], $config['dbpasswd'], $config['dbname'], $config['dbport']);
|
||||
|
||||
return $db;
|
||||
|
Reference in New Issue
Block a user