r11559 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11558‎ | r11559 | r11560 >
Date:02:47, 29 October 2005
Author:avar
Status:old
Tags:
Comment:
* brion, the preprocessResults() function you removed on the last commit is
there so that one large query gets run to check for the existance of pages
rather than up to 500 individual queries, of course it didn't work but that's
another issue alltogather..
Modified paths:
  • /trunk/phase3/includes/SpecialWantedcategories.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialWantedcategories.php
@@ -43,6 +43,23 @@
4444
4545 function sortDescending() { return true; }
4646
 47+ /**
 48+ * Fetch user page links and cache their existence
 49+ */
 50+ function preprocessResults( &$db, &$res ) {
 51+ global $wgLinkCache;
 52+
 53+ $batch = new LinkBatch;
 54+ while ( $row = $db->fetchObject( $res ) )
 55+ $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
 56+ $batch->execute( $wgLinkCache );
 57+
 58+ // Back to start for display
 59+ if ( $db->numRows( $res ) > 0 )
 60+ // If there are no rows we get an error seeking.
 61+ $db->dataSeek( $res, 0 );
 62+ }
 63+
4764 function formatResult( $skin, $result ) {
4865 global $wgContLang;
4966

Status & tagging log