r74743 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74742‎ | r74743 | r74744 >
Date:22:35, 13 October 2010
Author:reedy
Status:ok
Tags:
Comment:
Assignment in loop conditions suck

while ( $row = $dbw->fetchObject( $res ) ) { to foreach ( $res as $row ) in config
Modified paths:
  • /trunk/phase3/config/Installer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/config/Installer.php
@@ -1249,7 +1249,7 @@
12501250 if ( $conf->DBtype == 'mysql' && version_compare( $myver, "4.1.2", "ge" ) ) {
12511251 $res = $wgDatabase->query( 'SHOW ENGINES' );
12521252 $found = false;
1253 - while ( $row = $wgDatabase->fetchObject( $res ) ) {
 1253+ foreach ( $res as $row ) {
12541254 if ( $row->Engine == $conf->DBengine && ( $row->Support == 'YES' || $row->Support == 'DEFAULT' ) ) {
12551255 $found = true;
12561256 break;

Status & tagging log