r71137 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71136‎ | r71137 | r71138 >
Date:18:18, 15 August 2010
Author:demon
Status:ok (Comments)
Tags:
Comment:
Minor code style tweak
Modified paths:
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -28,11 +28,10 @@
2929 public static function newForDB( $db, $shared ) {
3030 switch( $db->getType() ) {
3131 case 'mysql':
32 - return new MysqlUpdater( $db, $shared );
3332 case 'sqlite':
34 - return new SqliteUpdater( $db, $shared );
3533 case 'oracle':
36 - return new OracleUpdater( $db, $shared );
 34+ $class = ucfirst( $db->getType() ) . 'Updater';
 35+ return new $class( $db, $shared );
3736 default:
3837 throw new MWException( __METHOD__ . ' called for unsupported $wgDBtype' );
3938 }

Comments

#Comment by Hashar (talk | contribs)   21:28, 10 October 2010

I tend to prefer the previous version. It is easier to read and understand.

#Comment by Hashar (talk | contribs)   09:37, 20 November 2010

Changed later with an array to be exhaustive.

Status & tagging log