1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

[ticket/12747] Drop support for Firebird

PHPBB3-12747
This commit is contained in:
Joas Schilling
2014-06-20 12:35:42 +02:00
parent 70d4ede9b2
commit 04164affe6
26 changed files with 9 additions and 1145 deletions

View File

@@ -25,7 +25,7 @@ if (!class_exists('PDO'))
*/
class phpbb_database_connection_odbc_pdo_wrapper extends PDO
{
// Name of the driver being used (i.e. mssql, firebird)
// Name of the driver being used (i.e. mssql)
public $driver = '';
// Version number of driver since PDO::getAttribute(PDO::ATTR_CLIENT_VERSION) is pretty useless for this

View File

@@ -145,25 +145,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
public function createXMLDataSet($path)
{
$db_config = $this->get_database_config();
// Firebird requires table and column names to be uppercase
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);
$xml_data = preg_replace_callback('/(?:(<column>))([a-z_]+)(?:(<\/column>))/', 'phpbb_database_test_case::to_upper', $xml_data);
$new_fixture = tmpfile();
fwrite($new_fixture, $xml_data);
fseek($new_fixture, 0);
$meta_data = stream_get_meta_data($new_fixture);
$path = $meta_data['uri'];
}
$this->fixture_xml_data = parent::createXMLDataSet($path);
return $this->fixture_xml_data;
}
@@ -246,7 +228,6 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
/**
* Converts a match in the middle of a string to uppercase.
* This is necessary for transforming the fixture information for Firebird tests
*
* @param $matches The array of matches from a regular expression
*

View File

@@ -116,7 +116,7 @@ class phpbb_database_test_connection_manager
// These require different connection strings on the phpBB side than they do in PDO
// so you must provide a DSN string for ODBC separately
if (!empty($this->config['custom_dsn']) && ($this->config['dbms'] == 'phpbb\db\driver\mssql' || $this->config['dbms'] == 'phpbb\db\driver\firebird'))
if (!empty($this->config['custom_dsn']) && $this->config['dbms'] == 'phpbb\db\driver\mssql')
{
$dsn = 'odbc:' . $this->config['custom_dsn'];
}
@@ -130,14 +130,6 @@ class phpbb_database_test_connection_manager
$this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('mssql', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
break;
case 'phpbb\db\driver\firebird':
if (!empty($this->config['custom_dsn']))
{
$this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('firebird', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
break;
}
// Fall through if they're using the firebird PDO driver and not the generic ODBC driver
default:
$this->pdo = new PDO($dsn, $this->config['dbuser'], $this->config['dbpasswd']);
break;
@@ -197,7 +189,6 @@ class phpbb_database_test_connection_manager
{
case 'phpbb\db\driver\sqlite':
case 'phpbb\db\driver\sqlite3':
case 'phpbb\db\driver\firebird':
$this->connect();
// Drop all of the tables
foreach ($this->get_tables() as $table)
@@ -298,13 +289,6 @@ class phpbb_database_test_connection_manager
FROM pg_stat_user_tables';
break;
case 'phpbb\db\driver\firebird':
$sql = 'SELECT rdb$relation_name
FROM rdb$relations
WHERE rdb$view_source is null
AND rdb$system_flag = 0';
break;
case 'phpbb\db\driver\oracle':
$sql = 'SELECT table_name
FROM USER_TABLES';
@@ -404,11 +388,6 @@ class phpbb_database_test_connection_manager
protected function get_dbms_data($dbms)
{
$available_dbms = array(
'phpbb\db\driver\firebird' => array(
'SCHEMA' => 'firebird',
'DELIM' => ';;',
'PDO' => 'firebird',
),
'phpbb\db\driver\mysqli' => array(
'SCHEMA' => 'mysql_41',
'DELIM' => ';',
@@ -478,18 +457,6 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
case 'phpbb\db\driver\firebird':
$sql = 'SELECT RDB$GENERATOR_NAME
FROM RDB$GENERATORS
WHERE RDB$SYSTEM_FLAG = 0';
$result = $this->pdo->query($sql);
while ($row = $result->fetch(PDO::FETCH_NUM))
{
$queries[] = 'DROP GENERATOR ' . current($row);
}
break;
case 'phpbb\db\driver\oracle':
$sql = 'SELECT sequence_name
FROM USER_SEQUENCES';