'Blob' => 'includes/db/Database.php',
'ChronologyProtector' => 'includes/db/LBFactory.php',
'Database' => 'includes/db/Database.php',
+ 'DatabaseBase' => 'includes/db/Database.php',
'DatabaseMssql' => 'includes/db/DatabaseMssql.php',
'DatabaseMysql' => 'includes/db/Database.php',
'DatabaseOracle' => 'includes/db/DatabaseOracle.php',
* Database abstraction object
* @ingroup Database
*/
-class Database {
+abstract class DatabaseBase {
#------------------------------------------------------------------------------
# Variables
}
/**
- * Same as new Database( ... ), kept for backward compatibility
+ * Same as new DatabaseMysql( ... ), kept for backward compatibility
* @param $server String: database server host
* @param $user String: database user name
* @param $password String: database user password
*/
static function newFromParams( $server, $user, $password, $dbName, $failFunction = false, $flags = 0 )
{
- return new Database( $server, $user, $password, $dbName, $failFunction, $flags );
+ return new DatabaseMysql( $server, $user, $password, $dbName, $failFunction, $flags );
}
/**
* @ingroup Database
* @see Database
*/
-class DatabaseMysql extends Database {
+class DatabaseMysql extends DatabaseBase {
# Inherit all
}
+/**
+ * Legacy support: Database == DatabaseMysql
+ */
+class Database extends DatabaseMysql {}
+
/******************************************************************************
* Utility classes
*****************************************************************************/
* Primary database interface
* @ingroup Database
*/
-class DatabaseIbm_db2 extends Database {
+class DatabaseIbm_db2 extends DatabaseBase {
/*
* Inherited members
protected $mLastQuery = '';
/**
* @ingroup Database
*/
-class DatabaseMssql extends Database {
+class DatabaseMssql extends DatabaseBase {
var $mAffectedRows;
var $mLastResult;
/**
* @ingroup Database
*/
-class DatabaseOracle extends Database {
+class DatabaseOracle extends DatabaseBase {
var $mInsertId = NULL;
var $mLastResult = NULL;
var $numeric_version = NULL;
/**
* @ingroup Database
*/
-class DatabasePostgres extends Database {
+class DatabasePostgres extends DatabaseBase {
var $mInsertId = NULL;
var $mLastResult = NULL;
var $numeric_version = NULL;
/**
* @ingroup Database
*/
-class DatabaseSqlite extends Database {
+class DatabaseSqlite extends DatabaseBase {
var $mAffectedRows;
var $mLastResult;
plan( 9 );
-$db = new Database( $wgDBserver, $wgDBuser, $wgDBpassword );
+$db = new DatabaseMysql( $wgDBserver, $wgDBuser, $wgDBpassword );
cmp_ok( $db->addQuotes( NULL ), '==',
'NULL', 'Add quotes to NULL' );
protected function buildTestDatabase( $tables ) {
global $testOptions, $wgDBprefix, $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname;
$wgDBprefix = 'parsertest_';
- $db = new Database(
+ $db = new DatabaseMysql(
$wgDBserver,
$wgDBadminuser,
$wgDBadminpassword,