Do ApiQueryAllUsers per r68337 (was using while (true)..)
authorSam Reed <reedy@users.mediawiki.org>
Sun, 20 Jun 2010 18:52:46 +0000 (18:52 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 20 Jun 2010 18:52:46 +0000 (18:52 +0000)
includes/api/ApiQueryAllUsers.php

index fcb8ba1..b138425 100644 (file)
@@ -128,9 +128,9 @@ class ApiQueryAllUsers extends ApiQueryBase {
                // Otherwise, the group of the new row is appended to the last entry.
                // The setContinue... is more complex because of this, and takes into account the higher sql limit
                // to make sure all rows that belong to the same user are received.
-               //
-               while ( true ) {
-                       $row = $db->fetchObject( $res );
+
+               $row = $db->fetchObject( $res );
+               foreach ( $res as $row ) {
                        $count++;
 
                        if ( !$row || $lastUser !== $row->user_name ) {
@@ -145,11 +145,6 @@ class ApiQueryAllUsers extends ApiQueryBase {
                                        }
                                }
 
-                               // No more rows left
-                               if ( !$row ) {
-                                       break;
-                               }
-
                                if ( $count > $limit ) {
                                        // We've reached the one extra which shows that there are additional pages to be had. Stop here...
                                        $this->setContinueEnumParameter( 'from', $this->keyToTitle( $row->user_name ) );