Assignment in loop conditions suck
authorSam Reed <reedy@users.mediawiki.org>
Wed, 13 Oct 2010 22:35:27 +0000 (22:35 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Wed, 13 Oct 2010 22:35:27 +0000 (22:35 +0000)
while ( $row = $dbw->fetchObject( $res ) ) { to foreach ( $res as $row ) in config

config/Installer.php

index 165740d..56323fc 100644 (file)
@@ -1249,7 +1249,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
                        if ( $conf->DBtype == 'mysql' && version_compare( $myver, "4.1.2", "ge" ) ) {
                                $res = $wgDatabase->query( 'SHOW ENGINES' );
                                $found = false;
-                               while ( $row = $wgDatabase->fetchObject( $res ) ) {
+                               foreach ( $res as $row ) {
                                        if ( $row->Engine == $conf->DBengine && ( $row->Support == 'YES' || $row->Support == 'DEFAULT' ) ) {
                                                $found = true;
                                                break;