Index: trunk/phase3/tests/MediaWiki_TestCase.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | protected function buildTestDatabase( $tables ) { |
10 | 10 | global $testOptions, $wgDBprefix, $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname; |
11 | 11 | $wgDBprefix = 'parsertest_'; |
12 | | - $db = new Database( |
| 12 | + $db = new DatabaseMysql( |
13 | 13 | $wgDBserver, |
14 | 14 | $wgDBadminuser, |
15 | 15 | $wgDBadminpassword, |
Index: trunk/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -153,7 +153,7 @@ |
154 | 154 | /** |
155 | 155 | * @ingroup Database |
156 | 156 | */ |
157 | | -class DatabaseOracle extends Database { |
| 157 | +class DatabaseOracle extends DatabaseBase { |
158 | 158 | var $mInsertId = NULL; |
159 | 159 | var $mLastResult = NULL; |
160 | 160 | var $numeric_version = NULL; |
Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | /** |
70 | 70 | * @ingroup Database |
71 | 71 | */ |
72 | | -class DatabasePostgres extends Database { |
| 72 | +class DatabasePostgres extends DatabaseBase { |
73 | 73 | var $mInsertId = NULL; |
74 | 74 | var $mLastResult = NULL; |
75 | 75 | var $numeric_version = NULL; |
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php |
— | — | @@ -102,7 +102,7 @@ |
103 | 103 | * Primary database interface |
104 | 104 | * @ingroup Database |
105 | 105 | */ |
106 | | -class DatabaseIbm_db2 extends Database { |
| 106 | +class DatabaseIbm_db2 extends DatabaseBase { |
107 | 107 | /* |
108 | 108 | * Inherited members |
109 | 109 | protected $mLastQuery = ''; |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | * Database abstraction object |
21 | 21 | * @ingroup Database |
22 | 22 | */ |
23 | | -class Database { |
| 23 | +abstract class DatabaseBase { |
24 | 24 | |
25 | 25 | #------------------------------------------------------------------------------ |
26 | 26 | # Variables |
— | — | @@ -307,7 +307,7 @@ |
308 | 308 | } |
309 | 309 | |
310 | 310 | /** |
311 | | - * Same as new Database( ... ), kept for backward compatibility |
| 311 | + * Same as new DatabaseMysql( ... ), kept for backward compatibility |
312 | 312 | * @param $server String: database server host |
313 | 313 | * @param $user String: database user name |
314 | 314 | * @param $password String: database user password |
— | — | @@ -317,7 +317,7 @@ |
318 | 318 | */ |
319 | 319 | static function newFromParams( $server, $user, $password, $dbName, $failFunction = false, $flags = 0 ) |
320 | 320 | { |
321 | | - return new Database( $server, $user, $password, $dbName, $failFunction, $flags ); |
| 321 | + return new DatabaseMysql( $server, $user, $password, $dbName, $failFunction, $flags ); |
322 | 322 | } |
323 | 323 | |
324 | 324 | /** |
— | — | @@ -2426,10 +2426,15 @@ |
2427 | 2427 | * @ingroup Database |
2428 | 2428 | * @see Database |
2429 | 2429 | */ |
2430 | | -class DatabaseMysql extends Database { |
| 2430 | +class DatabaseMysql extends DatabaseBase { |
2431 | 2431 | # Inherit all |
2432 | 2432 | } |
2433 | 2433 | |
| 2434 | +/** |
| 2435 | + * Legacy support: Database == DatabaseMysql |
| 2436 | + */ |
| 2437 | +class Database extends DatabaseMysql {} |
| 2438 | + |
2434 | 2439 | /****************************************************************************** |
2435 | 2440 | * Utility classes |
2436 | 2441 | *****************************************************************************/ |
Index: trunk/phase3/includes/db/DatabaseMssql.php |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | /** |
12 | 12 | * @ingroup Database |
13 | 13 | */ |
14 | | -class DatabaseMssql extends Database { |
| 14 | +class DatabaseMssql extends DatabaseBase { |
15 | 15 | |
16 | 16 | var $mAffectedRows; |
17 | 17 | var $mLastResult; |
Index: trunk/phase3/includes/db/DatabaseSqlite.php |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | /** |
12 | 12 | * @ingroup Database |
13 | 13 | */ |
14 | | -class DatabaseSqlite extends Database { |
| 14 | +class DatabaseSqlite extends DatabaseBase { |
15 | 15 | |
16 | 16 | var $mAffectedRows; |
17 | 17 | var $mLastResult; |
Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -303,6 +303,7 @@ |
304 | 304 | 'Blob' => 'includes/db/Database.php', |
305 | 305 | 'ChronologyProtector' => 'includes/db/LBFactory.php', |
306 | 306 | 'Database' => 'includes/db/Database.php', |
| 307 | + 'DatabaseBase' => 'includes/db/Database.php', |
307 | 308 | 'DatabaseMssql' => 'includes/db/DatabaseMssql.php', |
308 | 309 | 'DatabaseMysql' => 'includes/db/Database.php', |
309 | 310 | 'DatabaseOracle' => 'includes/db/DatabaseOracle.php', |
Index: trunk/phase3/t/inc/Database.t |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | |
14 | 14 | plan( 9 ); |
15 | 15 | |
16 | | -$db = new Database( $wgDBserver, $wgDBuser, $wgDBpassword ); |
| 16 | +$db = new DatabaseMysql( $wgDBserver, $wgDBuser, $wgDBpassword ); |
17 | 17 | |
18 | 18 | cmp_ok( $db->addQuotes( NULL ), '==', |
19 | 19 | 'NULL', 'Add quotes to NULL' ); |
Index: trunk/extensions/BoardVote/BoardVote_body.php |
— | — | @@ -215,7 +215,7 @@ |
216 | 216 | if ( !$this->mDb ) { |
217 | 217 | global $wgBoardVoteDBServer, $wgBoardVoteDB, $wgDBuser, $wgDBpassword; |
218 | 218 | |
219 | | - $this->mDb = new Database( $wgBoardVoteDBServer, $wgDBuser, $wgDBpassword, |
| 219 | + $this->mDb = new DatabaseMysql( $wgBoardVoteDBServer, $wgDBuser, $wgDBpassword, |
220 | 220 | $wgBoardVoteDB, /*failfn*/false, /*flags*/0, /*prefix*/'' ); |
221 | 221 | if ( !$this->mDb->isOpen() ) { |
222 | 222 | // This should be handled inside the constructor, but we'll check just in case |
Index: trunk/extensions/MWSearch/luceneUpdate.php |
— | — | @@ -122,7 +122,7 @@ |
123 | 123 | |
124 | 124 | function &streamingSlave( $db ) { |
125 | 125 | global $wgDBname; |
126 | | - $stream = new Database( $db->mServer, $db->mUser, $db->mPassword, $wgDBname ); |
| 126 | + $stream = new DatabaseMysql( $db->mServer, $db->mUser, $db->mPassword, $wgDBname ); |
127 | 127 | $stream->bufferResults( false ); |
128 | 128 | |
129 | 129 | $timeout = 3600 * 24; |
Index: trunk/tools/WikipediaStatistics/index.php |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | <pre><?php |
114 | 114 | |
115 | 115 | if ( isset( $_POST['update'] ) ) { |
116 | | - $dbr = new Database(); |
| 116 | + $dbr = new DatabaseMysql(); |
117 | 117 | $dateRange = array( |
118 | 118 | sprintf( |
119 | 119 | 'rev_timestamp > %s', |
Index: trunk/tools/switch-master/MasterSwitcher.php |
— | — | @@ -143,7 +143,7 @@ |
144 | 144 | |
145 | 145 | function getConnection( $host ) { |
146 | 146 | if ( !isset( $this->conns[$host] ) ) { |
147 | | - $this->conns[$host] = new Database( $host, $this->rootUser, $this->rootPass ); |
| 147 | + $this->conns[$host] = new DatabaseMysql( $host, $this->rootUser, $this->rootPass ); |
148 | 148 | } |
149 | 149 | return $this->conns[$host]; |
150 | 150 | } |