Index: trunk/extensions/ContributionScores/ContributionScores_body.php |
— | — | @@ -102,7 +102,7 @@ |
103 | 103 | |
104 | 104 | $skin = $wgUser->getSkin(); |
105 | 105 | $altrow = ''; |
106 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 106 | + foreach ( $res as $row ) { |
107 | 107 | $output .= "</tr><tr class='{$altrow}'>\n<td class='content'>" . |
108 | 108 | round($row->wiki_rank,0) . "\n</td><td class='content'>" . |
109 | 109 | $row->page_count . "\n</td><td class='content'>" . |
Index: trunk/extensions/Collection/Collection.body.php |
— | — | @@ -694,7 +694,7 @@ |
695 | 695 | |
696 | 696 | $count = 0; |
697 | 697 | $limitExceeded = false; |
698 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 698 | + foreach ( $res as $row ) { |
699 | 699 | if ( ++$count > $limit ) { |
700 | 700 | $limitExceeded = true; |
701 | 701 | break; |
Index: trunk/extensions/Renameuser/Renameuser_body.php |
— | — | @@ -311,7 +311,7 @@ |
312 | 312 | |
313 | 313 | $output = ''; |
314 | 314 | $skin = $wgUser->getSkin(); |
315 | | - while ( $row = $dbr->fetchObject( $pages ) ) { |
| 315 | + foreach ( $pages as $row ) { |
316 | 316 | $oldPage = Title::makeTitleSafe( $row->page_namespace, $row->page_title ); |
317 | 317 | $newPage = Title::makeTitleSafe( $row->page_namespace, |
318 | 318 | preg_replace( '!^[^/]+!', $newusername->getDBkey(), $row->page_title ) ); |
Index: trunk/extensions/Oversight/HideRevision_body.php |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | $changes = ChangesList::newFromUser( $wgUser ); |
133 | 133 | |
134 | 134 | $out = $changes->beginRecentChangesList(); |
135 | | - while( $row = $resultSet->fetchObject() ) { |
| 135 | + foreach ( $resultSet as $row ) { |
136 | 136 | $rc = RecentChange::newFromCurRow( $row ); |
137 | 137 | $rc->counter = 0; // ??? |
138 | 138 | $out .= $changes->recentChangesLine( $rc ); |
— | — | @@ -488,7 +488,7 @@ |
489 | 489 | $dbr = wfGetDB( DB_SLAVE ); |
490 | 490 | $result = $this->getRevisions( $dbr, array( 'hidden_rev_id' => $revision ) ); |
491 | 491 | |
492 | | - while( $row = $dbr->fetchObject( $result ) ) { |
| 492 | + foreach ( $result as $row ) { |
493 | 493 | $info = $this->listRow( $row ); |
494 | 494 | $list = $this->revisionInfo( $row ); |
495 | 495 | $rev = new Revision( $row ); |
— | — | @@ -534,7 +534,7 @@ |
535 | 535 | $dbr = wfGetDB( DB_SLAVE ); |
536 | 536 | $result = $this->getRevisions( $dbr, array( 'hidden_rev_id' => $revision ) ); |
537 | 537 | |
538 | | - while( $row = $dbr->fetchObject( $result ) ) { |
| 538 | + foreach ( $result as $row ) { |
539 | 539 | $info = $this->listRow( $row ); |
540 | 540 | $list = $this->revisionInfo( $row ); |
541 | 541 | $rev = new Revision( $row ); |
— | — | @@ -643,7 +643,7 @@ |
644 | 644 | wfProfileIn( __METHOD__ ); |
645 | 645 | # Do a link batch query |
646 | 646 | $lb = new LinkBatch(); |
647 | | - while( $row = $this->mResult->fetchObject() ) { |
| 647 | + foreach ( $this->mResult as $row ) { |
648 | 648 | $lb->add( $row->page_namespace, $row->page_title ); |
649 | 649 | } |
650 | 650 | $lb->execute(); |
Index: trunk/extensions/CommunityVoice/Modules/Ratings.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | array( 'vot_category' => $category ) |
42 | 42 | ); |
43 | 43 | $titles = array(); |
44 | | - while ( $row = $result->fetchRow() ) { |
| 44 | + foreach ( $result as $row ) { |
45 | 45 | $titles[] = (string)$row['vot_title']; |
46 | 46 | } |
47 | 47 | return $titles; |
Index: trunk/extensions/ConfirmEdit/ConfirmEdit_body.php |
— | — | @@ -484,7 +484,7 @@ |
485 | 485 | $res = $dbr->select( 'externallinks', array( 'el_to' ), |
486 | 486 | array( 'el_from' => $id ), __METHOD__ ); |
487 | 487 | $links = array(); |
488 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 488 | + foreach ( $res as $row ) { |
489 | 489 | $links[] = $row->el_to; |
490 | 490 | } |
491 | 491 | return $links; |
Index: trunk/extensions/ProofreadPage/ProofreadPage_body.php |
— | — | @@ -152,7 +152,7 @@ |
153 | 153 | __METHOD__ |
154 | 154 | ); |
155 | 155 | |
156 | | - while ( $x = $dbr->fetchObject( $result ) ) { |
| 156 | + foreach ( $result as $x ) { |
157 | 157 | $ref_title = Title::makeTitle( $x->page_namespace, $x->page_title ); |
158 | 158 | if ( preg_match( "/^$index_namespace:(.*)$/", $ref_title->getPrefixedText() ) ) { |
159 | 159 | $title->pr_index_title = $ref_title->getPrefixedText(); |
— | — | @@ -488,7 +488,7 @@ |
489 | 489 | $query .= ')'; |
490 | 490 | $res = $dbr->query( $query, __METHOD__ ); |
491 | 491 | |
492 | | - while ( $x = $dbr->fetchObject( $res ) ) { |
| 492 | + foreach ( $res as $x ) { |
493 | 493 | $pdbk = $page_ids[$x->cl_from]; |
494 | 494 | switch( $x->cl_to ) { |
495 | 495 | case str_replace( ' ' , '_' , wfMsgForContent( 'proofreadpage_quality0_category' ) ): |
— | — | @@ -882,7 +882,7 @@ |
883 | 883 | ); |
884 | 884 | |
885 | 885 | if( $res ) { |
886 | | - while( $o = $dbr->fetchObject( $res ) ) { |
| 886 | + foreach ( $res as $o ) { |
887 | 887 | array_push( $q0_pages, $o->page_title ); |
888 | 888 | } |
889 | 889 | } |
Index: trunk/extensions/GlobalBlocking/ApiQueryGlobalBlocks.php |
— | — | @@ -104,8 +104,7 @@ |
105 | 105 | $res = $this->select(__METHOD__); |
106 | 106 | |
107 | 107 | $count = 0; |
108 | | - while($row = $res->fetchObject()) |
109 | | - { |
| 108 | + foreach ( $res as $row ) { |
110 | 109 | if(++$count > $params['limit']) |
111 | 110 | { |
112 | 111 | // We've had enough |
Index: trunk/extensions/MWSearch/luceneUpdate.php |
— | — | @@ -240,7 +240,7 @@ |
241 | 241 | $limit ); |
242 | 242 | |
243 | 243 | $errorCount = 0; |
244 | | - while( $row = $this->dbstream->fetchObject( $result ) ) { |
| 244 | + foreach ( $result as $row ) { |
245 | 245 | $this->progress(); |
246 | 246 | |
247 | 247 | $title = Title::makeTitle( $row->page_namespace, $row->page_title ); |
— | — | @@ -304,7 +304,7 @@ |
305 | 305 | $this->init( $max ); |
306 | 306 | $lastError = true; |
307 | 307 | |
308 | | - while( $row = $this->dbstream->fetchObject( $result ) ) { |
| 308 | + foreach ( $result as $row ) { |
309 | 309 | $this->progress(); |
310 | 310 | $title = Title::makeTitle( $row->log_namespace, $row->log_title ); |
311 | 311 | $hit = MWSearchUpdater::deletePage( $wgDBname, $title ); |
— | — | @@ -358,7 +358,7 @@ |
359 | 359 | $this->init( $max ); |
360 | 360 | $lastError = true; |
361 | 361 | |
362 | | - while( $row = $this->dbstream->fetchObject( $result ) ) { |
| 362 | + foreach ( $result as $row ) { |
363 | 363 | $this->progress(); |
364 | 364 | $rev = new Revision( $row ); |
365 | 365 | if( is_object( $rev ) ) { |
Index: trunk/extensions/SpamBlacklist/SpamBlacklist_body.php |
— | — | @@ -287,7 +287,7 @@ |
288 | 288 | $res = $dbr->select( 'externallinks', array( 'el_to' ), |
289 | 289 | array( 'el_from' => $id ), __METHOD__ ); |
290 | 290 | $links = array(); |
291 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 291 | + foreach ( $res as $row ) { |
292 | 292 | $links[] = $row->el_to; |
293 | 293 | } |
294 | 294 | return $links; |
Index: trunk/extensions/CategoryTree/CategoryTreeFunctions.php |
— | — | @@ -524,7 +524,7 @@ |
525 | 525 | |
526 | 526 | $s = ''; |
527 | 527 | |
528 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 528 | + foreach ( $res as $row ) { |
529 | 529 | # TODO: translation support; ideally added to Title object |
530 | 530 | $t = Title::newFromRow( $row ); |
531 | 531 | |
Index: trunk/extensions/Nuke/Nuke_body.php |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | ) |
132 | 132 | ); |
133 | 133 | $pages = array(); |
134 | | - while( $row = $dbr->fetchObject( $result ) ) { |
| 134 | + foreach ( $result as $row ) { |
135 | 135 | $pages[] = array( Title::makeTitle( $row->rc_namespace, $row->rc_title ), $row->edits ); |
136 | 136 | } |
137 | 137 | $dbr->freeResult( $result ); |
Index: trunk/extensions/ContributionReporting/FundraiserStatistics_body.php |
— | — | @@ -244,7 +244,7 @@ |
245 | 245 | ); |
246 | 246 | $result = array(); |
247 | 247 | $ytd = 0; |
248 | | - while ( $row = $dbr->fetchRow( $select ) ) { |
| 248 | + foreach ( $select as $row ) { |
249 | 249 | $row[] = $ytd += $row[1]; // YTD |
250 | 250 | $result[] = $row; |
251 | 251 | } |
Index: trunk/extensions/CentralAuth/CentralAuthUser.php |
— | — | @@ -177,7 +177,7 @@ |
178 | 178 | ); |
179 | 179 | |
180 | 180 | $sets = array(); |
181 | | - while ( $row = $dbr->fetchObject( $resSets ) ) { |
| 181 | + foreach ( $resSets as $row ) { |
182 | 182 | $sets[$row->ggr_group] = WikiSet::newFromRow( $row ); |
183 | 183 | } |
184 | 184 | |
— | — | @@ -185,7 +185,7 @@ |
186 | 186 | $rights = array(); |
187 | 187 | $groups = array(); |
188 | 188 | |
189 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 189 | + foreach ( $res as $row ) { |
190 | 190 | $set = @$sets[$row->ggp_group]; |
191 | 191 | $rights[] = array( 'right' => $row->ggp_permission, 'set' => $set ? $set->getID() : false ); |
192 | 192 | $groups[$row->ggp_group] = 1; |
— | — | @@ -1314,7 +1314,7 @@ |
1315 | 1315 | $result = $dbw->safeQuery( $sql, $this->mName ); |
1316 | 1316 | |
1317 | 1317 | $dbs = array(); |
1318 | | - while ( $row = $dbw->fetchObject( $result ) ) { |
| 1318 | + foreach ( $result as $row ) { |
1319 | 1319 | $dbs[] = $row->ln_wiki; |
1320 | 1320 | } |
1321 | 1321 | $dbw->freeResult( $result ); |
— | — | @@ -1432,7 +1432,7 @@ |
1433 | 1433 | __METHOD__ ); |
1434 | 1434 | |
1435 | 1435 | $wikis = array(); |
1436 | | - while ( $row = $result->fetchObject() ) { |
| 1436 | + foreach ( $result as $row ) { |
1437 | 1437 | $wikis[] = $row->lu_wiki; |
1438 | 1438 | } |
1439 | 1439 | $dbw->freeResult( $result ); |
— | — | @@ -1475,7 +1475,7 @@ |
1476 | 1476 | __METHOD__ ); |
1477 | 1477 | |
1478 | 1478 | $wikis = array(); |
1479 | | - while ( $row = $dbw->fetchObject( $result ) ) { |
| 1479 | + foreach ( $result as $row ) { |
1480 | 1480 | $wikis[$row->lu_wiki] = array( |
1481 | 1481 | 'wiki' => $row->lu_wiki, |
1482 | 1482 | 'attachedTimestamp' => wfTimestampOrNull( TS_MW, |
— | — | @@ -1859,8 +1859,9 @@ |
1860 | 1860 | |
1861 | 1861 | $groups = array(); |
1862 | 1862 | |
1863 | | - while ( $row = $dbr->fetchObject( $res ) ) |
| 1863 | + foreach ( $res as $row ) { |
1864 | 1864 | $groups[] = $row->ggp_group; |
| 1865 | + } |
1865 | 1866 | |
1866 | 1867 | return $groups; |
1867 | 1868 | } |
— | — | @@ -1873,7 +1874,7 @@ |
1874 | 1875 | |
1875 | 1876 | $rights = array(); |
1876 | 1877 | |
1877 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 1878 | + foreach ( $res as $row ) { |
1878 | 1879 | $rights[] = $row->ggp_permission; |
1879 | 1880 | } |
1880 | 1881 | |
— | — | @@ -1894,8 +1895,9 @@ |
1895 | 1896 | |
1896 | 1897 | $rights = array(); |
1897 | 1898 | |
1898 | | - while ( $row = $dbr->fetchObject( $res ) ) |
| 1899 | + foreach ( $res as $row ) { |
1899 | 1900 | $rights[] = $row->ggp_permission; |
| 1901 | + } |
1900 | 1902 | |
1901 | 1903 | return $rights; |
1902 | 1904 | } |
Index: trunk/extensions/CentralAuth/SpecialGlobalGroupPermissions.php |
— | — | @@ -362,7 +362,7 @@ |
363 | 363 | $res = $dbr->select( array( 'global_user_groups', 'globaluser' ), 'gu_name', array( 'gug_group' => $group, 'gu_id=gug_user' ), __METHOD__ ); |
364 | 364 | |
365 | 365 | // Invalidate their rights cache. |
366 | | - while ( $row = $res->fetchObject() ) { |
| 366 | + foreach ( $res as $row ) { |
367 | 367 | $cu = new CentralAuthUser( $row->gu_name ); |
368 | 368 | $cu->quickInvalidateCache(); |
369 | 369 | } |
Index: trunk/extensions/CentralAuth/WikiSet.php |
— | — | @@ -183,7 +183,7 @@ |
184 | 184 | $dbr = CentralAuthUser::getCentralSlaveDB(); |
185 | 185 | $res = $dbr->select( 'wikiset', '*', false, __METHOD__ ); |
186 | 186 | $result = array(); |
187 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 187 | + foreach ( $res as $row ) { |
188 | 188 | $result[] = self::newFromRow( $row ); |
189 | 189 | } |
190 | 190 | return $result; |
Index: trunk/extensions/CentralAuth/SpecialGlobalUsers.php |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | |
126 | 126 | $this->mResult->rewind(); |
127 | 127 | |
128 | | - while ( $row = $this->mResult->fetchObject() ) { |
| 128 | + foreach ( $this->mResult as $row ) { |
129 | 129 | $batch->addObj( Title::makeTitleSafe( NS_USER, $row->gu_name ) ); |
130 | 130 | } |
131 | 131 | $batch->execute(); |
— | — | @@ -141,7 +141,7 @@ |
142 | 142 | } |
143 | 143 | $result = $this->mDb->select( 'global_user_groups', 'gug_group', array( 'gug_user' => $row->gu_id ), __METHOD__ ); |
144 | 144 | $rights = array(); |
145 | | - while ( $row2 = $this->mDb->fetchObject( $result ) ) { |
| 145 | + foreach ( $result as $row2 ) { |
146 | 146 | $rights[] = User::makeGroupLinkWiki( $row2->gug_group, User::getGroupMember( $row2->gug_group ) ); |
147 | 147 | } |
148 | 148 | return implode( ', ', $rights ); |
Index: trunk/extensions/AbuseFilter/ApiQueryAbuseFilters.php |
— | — | @@ -97,7 +97,7 @@ |
98 | 98 | $showhidden = $wgUser->isAllowed( 'abusefilter-modify' ); |
99 | 99 | |
100 | 100 | $count = 0; |
101 | | - while ( $row = $res->fetchObject() ) { |
| 101 | + foreach ( $res as $row ) { |
102 | 102 | if ( ++$count > $params['limit'] ) { |
103 | 103 | // We've had enough |
104 | 104 | $this->setContinueEnumParameter( 'startid', $row->af_id ); |
Index: trunk/extensions/AbuseFilter/AbuseFilterVariableHolder.php |
— | — | @@ -330,7 +330,7 @@ |
331 | 331 | ); |
332 | 332 | |
333 | 333 | $users = array(); |
334 | | - while ( $user = $dbr->fetchRow( $res ) ) { |
| 334 | + foreach ( $res as $user ) { |
335 | 335 | $users[] = $user[0]; |
336 | 336 | } |
337 | 337 | $result = $users; |
Index: trunk/extensions/AbuseFilter/ApiQueryAbuseLog.php |
— | — | @@ -104,7 +104,7 @@ |
105 | 105 | $res = $this->select( __METHOD__ ); |
106 | 106 | |
107 | 107 | $count = 0; |
108 | | - while ( $row = $res->fetchObject() ) { |
| 108 | + foreach ( $res as $row ) { |
109 | 109 | if ( ++$count > $params['limit'] ) { |
110 | 110 | // We've had enough |
111 | 111 | $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->afl_timestamp ) ); |
Index: trunk/extensions/AbuseFilter/AbuseFilter.hooks.php |
— | — | @@ -155,7 +155,7 @@ |
156 | 156 | array( 'abuse_filter' => array( 'INNER JOIN', 'afa_filter=af_id' ) ) |
157 | 157 | ); |
158 | 158 | |
159 | | - while ( $row = $res->fetchObject() ) { |
| 159 | + foreach ( $res as $row ) { |
160 | 160 | $emptyTags = array_filter( |
161 | 161 | array_merge( explode( "\n", $row->afa_parameters ), $emptyTags ) |
162 | 162 | ); |
Index: trunk/extensions/ReaderFeedback/specialpages/RatedPages_body.php |
— | — | @@ -155,7 +155,7 @@ |
156 | 156 | wfProfileIn( __METHOD__ ); |
157 | 157 | # Do a link batch query... |
158 | 158 | $lb = new LinkBatch(); |
159 | | - while( $row = $this->mResult->fetchObject() ) { |
| 159 | + foreach ( $this->mResult as $row ) { |
160 | 160 | $lb->add( $row->page_namespace, $row->page_title ); |
161 | 161 | } |
162 | 162 | $lb->execute(); |
Index: trunk/extensions/ReaderFeedback/specialpages/RatingHistory_body.php |
— | — | @@ -216,7 +216,7 @@ |
217 | 217 | // Label spacing |
218 | 218 | $int = intval( ceil($days/10) ); // 10 labels at most |
219 | 219 | $dates = $drating = $arating = $dcount = ""; |
220 | | - while( $row = $res->fetchObject() ) { |
| 220 | + foreach ( $res as $row ) { |
221 | 221 | $totalVal += (int)$row->rfh_total; |
222 | 222 | $totalCount += (int)$row->rfh_count; |
223 | 223 | $dayAve = sprintf( '%4.2f', (real)$row->rfh_total/(real)$row->rfh_count ); |
— | — | @@ -386,7 +386,7 @@ |
387 | 387 | if( !$maxC ) return false; |
388 | 388 | // Label spacing |
389 | 389 | $int = intval( ceil($days/10) ); // 10 labels at most |
390 | | - while( $row = $res->fetchObject() ) { |
| 390 | + foreach ( $res as $row ) { |
391 | 391 | $totalVal += (int)$row->rfh_total; |
392 | 392 | $totalCount += (int)$row->rfh_count; |
393 | 393 | $dayCount = (real)$row->rfh_count; |
— | — | @@ -521,7 +521,7 @@ |
522 | 522 | # Get max count and average rating |
523 | 523 | $total = $count = $ave = $maxC = $days = 0; |
524 | 524 | if( $dbr->numRows($res) > 0 ) { |
525 | | - while( $row = $dbr->fetchObject($res) ) { |
| 525 | + foreach ( $res as $row ) { |
526 | 526 | if( !isset($lower) ) { |
527 | 527 | $lower = wfTimestamp( TS_UNIX, $row->rfh_date ); // first day |
528 | 528 | } |
— | — | @@ -648,7 +648,7 @@ |
649 | 649 | $columns = 4; |
650 | 650 | $count = 0; |
651 | 651 | $html = "<table class='rfb-reader_feedback_users'><tr>"; |
652 | | - while( $row = $res->fetchObject() ) { |
| 652 | + foreach ( $res as $row ) { |
653 | 653 | $title = Title::makeTitleSafe( NS_USER, $row->name ); |
654 | 654 | if( is_null($title) ) continue; // bad IP? |
655 | 655 | $html .= '<td>'.$this->skin->makeLinkObj( $title, $title->getText() )." [{$row->n}]</td>"; |
Index: trunk/extensions/ReaderFeedback/ReaderFeedback.class.php |
— | — | @@ -208,7 +208,7 @@ |
209 | 209 | $votes[$tag] = array( 0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0 ); |
210 | 210 | } |
211 | 211 | // Read votes and tally the numbers |
212 | | - while( $row = $dbr->fetchObject($res) ) { |
| 212 | + foreach ( $res as $row ) { |
213 | 213 | $dims = ReaderFeedback::expandRatings( $row->rfb_ratings ); |
214 | 214 | foreach( $dims as $tag => $val ) { |
215 | 215 | if( isset($votes[$tag]) && isset($votes[$tag][$val]) ) { |
Index: trunk/extensions/CheckUser/CheckUser_body.php |
— | — | @@ -356,7 +356,7 @@ |
357 | 357 | $blockip = SpecialPage::getTitleFor( 'Blockip' ); |
358 | 358 | $ips_edits = array(); |
359 | 359 | $counter = 0; |
360 | | - while ( $row = $dbr->fetchObject( $ret ) ) { |
| 360 | + foreach ( $ret as $row ) { |
361 | 361 | if ( $counter >= 5000 ) { |
362 | 362 | // FIXME: addWikiMSG |
363 | 363 | $wgOut->addHTML( wfMsgExt( 'checkuser-limited', array( 'parse' ) ) ); |
— | — | @@ -507,7 +507,7 @@ |
508 | 508 | # List out each IP that has edits |
509 | 509 | $s = wfMsgExt( 'checkuser-too-many', array( 'parse' ) ); |
510 | 510 | $s .= '<ol>'; |
511 | | - while ( $row = $ret->fetchObject() ) { |
| 511 | + foreach ( $ret as $row ) { |
512 | 512 | if ( $counter >= 5000 ) { |
513 | 513 | // FIXME: addWikiMsg |
514 | 514 | $wgOut->addHTML( wfMsgExt( 'checkuser-limited', array( 'parse' ) ) ); |
— | — | @@ -556,7 +556,7 @@ |
557 | 557 | $this->preCacheMessages(); |
558 | 558 | # Try to optimize this query |
559 | 559 | $lb = new LinkBatch; |
560 | | - while ( $row = $ret->fetchObject() ) { |
| 560 | + foreach ( $ret as $row ) { |
561 | 561 | $userText = str_replace( ' ', '_', $row->cuc_user_text ); |
562 | 562 | $lb->add( $row->cuc_namespace, $row->cuc_title ); |
563 | 563 | $lb->add( NS_USER, $userText ); |
— | — | @@ -566,7 +566,7 @@ |
567 | 567 | $ret->seek( 0 ); |
568 | 568 | # List out the edits |
569 | 569 | $s = '<div id="checkuserresults">'; |
570 | | - while ( $row = $ret->fetchObject() ) { |
| 570 | + foreach ( $ret as $row ) { |
571 | 571 | if ( $counter >= 5000 ) { |
572 | 572 | // FIXME: addWikiMsg |
573 | 573 | $wgOut->addHTML( wfMsgExt( 'checkuser-limited', array( 'parse' ) ) ); |
— | — | @@ -645,13 +645,13 @@ |
646 | 646 | $ret = $dbr->query( $sql, __METHOD__ ); |
647 | 647 | # Try to optimize this query |
648 | 648 | $lb = new LinkBatch; |
649 | | - while ( $row = $ret->fetchObject() ) { |
| 649 | + foreach ( $ret as $row ) { |
650 | 650 | $lb->add( $row->cuc_namespace, $row->cuc_title ); |
651 | 651 | } |
652 | 652 | $lb->execute(); |
653 | 653 | $ret->seek( 0 ); |
654 | 654 | $s = ''; |
655 | | - while ( $row = $ret->fetchObject() ) { |
| 655 | + foreach ( $ret as $row ) { |
656 | 656 | if ( !$ip = htmlspecialchars( $row->cuc_ip ) ) { |
657 | 657 | continue; |
658 | 658 | } |
— | — | @@ -686,14 +686,14 @@ |
687 | 687 | } else { |
688 | 688 | # Try to optimize this query |
689 | 689 | $lb = new LinkBatch; |
690 | | - while ( $row = $ret->fetchObject() ) { |
| 690 | + foreach ( $ret as $row ) { |
691 | 691 | $lb->add( $row->cuc_namespace, $row->cuc_title ); |
692 | 692 | } |
693 | 693 | $lb->execute(); |
694 | 694 | $ret->seek( 0 ); |
695 | 695 | # List out the edits |
696 | 696 | $s = '<div id="checkuserresults">'; |
697 | | - while ( $row = $ret->fetchObject() ) { |
| 697 | + foreach ( $ret as $row ) { |
698 | 698 | $s .= $this->CUChangesLine( $row, $reason ); |
699 | 699 | } |
700 | 700 | $s .= '</ul></div>'; |
— | — | @@ -769,7 +769,7 @@ |
770 | 770 | $s = '<h5>' . wfMsg( 'checkuser-too-many' ) . '</h5>'; |
771 | 771 | $s .= '<ol>'; |
772 | 772 | $counter = 0; |
773 | | - while ( $row = $ret->fetchObject() ) { |
| 773 | + foreach ( $ret as $row ) { |
774 | 774 | if ( $counter >= 5000 ) { |
775 | 775 | $wgOut->addHTML( wfMsgExt( 'checkuser-limited', array( 'parse' ) ) ); |
776 | 776 | break; |
Index: trunk/extensions/DynamicPageList/DPLMain.php |
— | — | @@ -2947,7 +2947,7 @@ |
2948 | 2948 | $lastNamespaceFound = ''; |
2949 | 2949 | $lastTitleFound = ''; |
2950 | 2950 | |
2951 | | - while ( $row = $dbr->fetchObject ( $res ) ) { |
| 2951 | + foreach ( $res as $row ) { |
2952 | 2952 | $iArticle++; |
2953 | 2953 | |
2954 | 2954 | // in random mode skip articles which were not chosen |
— | — | @@ -3426,7 +3426,7 @@ |
3427 | 3427 | . str_replace( ' ', '_', $cat ) . "'" . " WHERE page_namespace='14'", |
3428 | 3428 | __METHOD__ |
3429 | 3429 | ); |
3430 | | - while ( $row = $dbr->fetchObject ( $res ) ) { |
| 3430 | + foreach ( $res as $row ) { |
3431 | 3431 | if ( $depth > 1 ) { |
3432 | 3432 | $cats .= '|' . self::getSubcategories( $row->page_title, $sPageTable, $depth - 1 ); |
3433 | 3433 | } else { |