r79840 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79839‎ | r79840 | r79841 >
Date:20:25, 7 January 2011
Author:demon
Status:ok
Tags:
Comment:
Remove ancient and deprecated newFromParams() constructor wrappers from various DatabaseBase implementations. Only callers are AskSql and WikiTrust. Both are calling the (very old) Database class anyway, so are obviously expecting a MySQL connection and can use the fallback (which yells wfDeprecated) in DatabaseBase
Modified paths:
  • /trunk/phase3/includes/db/DatabaseIbm_db2.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseMssql.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseOracle.php (modified) (history)
  • /trunk/phase3/includes/db/DatabasePostgres.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseSqlite.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabaseOracle.php
@@ -226,11 +226,6 @@
227227 return true;
228228 }
229229
230 - static function newFromParams( $server, $user, $password, $dbName, $flags = 0 )
231 - {
232 - return new DatabaseOracle( $server, $user, $password, $dbName, $flags );
233 - }
234 -
235230 /**
236231 * Usually aborts on failure
237232 */
Index: trunk/phase3/includes/db/DatabasePostgres.php
@@ -144,10 +144,6 @@
145145 return $this->numRows( $res );
146146 }
147147
148 - static function newFromParams( $server, $user, $password, $dbName, $flags = 0 ) {
149 - return new DatabasePostgres( $server, $user, $password, $dbName, $flags );
150 - }
151 -
152148 /**
153149 * Usually aborts on failure
154150 */
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php
@@ -429,23 +429,6 @@
430430 }
431431
432432 /**
433 - * Returns a fresh instance of this class
434 - *
435 - * @param $server String: hostname of database server
436 - * @param $user String: username
437 - * @param $password String
438 - * @param $dbName String: database name on the server
439 - * @param $flags Integer: database behaviour flags (optional, unused)
440 - * @return DatabaseIbm_db2 object
441 - */
442 - static function newFromParams( $server, $user, $password, $dbName,
443 - $flags = 0 )
444 - {
445 - return new DatabaseIbm_db2( $server, $user, $password, $dbName,
446 - $flags );
447 - }
448 -
449 - /**
450433 * Retrieves the most current database error
451434 * Forces a database rollback
452435 */
Index: trunk/phase3/includes/db/DatabaseMssql.php
@@ -49,10 +49,6 @@
5050 return false;
5151 }
5252
53 - static function newFromParams( $server, $user, $password, $dbName, $flags = 0 ) {
54 - return new DatabaseMssql( $server, $user, $password, $dbName, $flags );
55 - }
56 -
5753 /**
5854 * Usually aborts on failure
5955 */
Index: trunk/phase3/includes/db/DatabaseSqlite.php
@@ -42,10 +42,6 @@
4343 */
4444 function implicitGroupby() { return false; }
4545
46 - static function newFromParams( $server, $user, $password, $dbName, $flags = 0 ) {
47 - return new DatabaseSqlite( $server, $user, $password, $dbName, $flags );
48 - }
49 -
5046 /** Open an SQLite database and return a resource handle to it
5147 * NOTE: only $dbName is used, the other parameters are irrelevant for SQLite databases
5248 */

Status & tagging log