1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-29 19:20:23 +02:00

[ticket/16643] Add Doctrine DBAL to phpBB

PHPBB3-16643
This commit is contained in:
Máté Bartus
2021-01-16 10:53:46 +01:00
parent d9bfb4d01d
commit aab2679966
17 changed files with 990 additions and 123 deletions

View File

@@ -41,6 +41,7 @@ class database
'LABEL' => 'MySQL with MySQLi Extension',
'SCHEMA' => 'mysql_41',
'MODULE' => 'mysqli',
'DOCTRINE' => ['pdo_mysql'],
'DELIM' => ';',
'DRIVER' => 'phpbb\db\driver\mysqli',
'AVAILABLE' => true,
@@ -50,6 +51,7 @@ class database
'LABEL' => 'MS SQL Server [ ODBC ]',
'SCHEMA' => 'mssql',
'MODULE' => 'odbc',
'DOCTRINE' => ['pdo_sqlsrv'],
'DELIM' => ';',
'DRIVER' => 'phpbb\db\driver\mssql_odbc',
'AVAILABLE' => true,
@@ -59,6 +61,7 @@ class database
'LABEL' => 'MS SQL Server 2005+ [ Native ]',
'SCHEMA' => 'mssql',
'MODULE' => 'sqlsrv',
'DOCTRINE' => ['pdo_sqlsrv'],
'DELIM' => ';',
'DRIVER' => 'phpbb\db\driver\mssqlnative',
'AVAILABLE' => true,
@@ -77,6 +80,7 @@ class database
'LABEL' => 'PostgreSQL 8.3+',
'SCHEMA' => 'postgres',
'MODULE' => 'pgsql',
'DOCTRINE' => ['pdo_pgsql'],
'DELIM' => ';',
'DRIVER' => 'phpbb\db\driver\postgres',
'AVAILABLE' => true,
@@ -86,6 +90,7 @@ class database
'LABEL' => 'SQLite3',
'SCHEMA' => 'sqlite',
'MODULE' => 'sqlite3',
'DOCTRINE' => ['pdo_sqlite'],
'DELIM' => ';',
'DRIVER' => 'phpbb\db\driver\sqlite3',
'AVAILABLE' => true,
@@ -166,6 +171,33 @@ class database
continue;
}
if (array_key_exists('DOCTRINE', $db_array))
{
$available = false;
foreach ($db_array['DOCTRINE'] as $dll)
{
if (@extension_loaded($dll))
{
$available = true;
break;
}
}
if (!$available)
{
if ($return_unavailable)
{
$available_dbms[$db_name]['AVAILABLE'] = false;
}
else
{
unset($available_dbms[$db_name]);
}
continue;
}
}
$any_dbms_available = true;
}