From: jenkins-bot Date: Wed, 2 Nov 2016 23:37:18 +0000 (+0000) Subject: Merge "Use Database::addQuotes in Special:WantedPages/UnwatchedPages" X-Git-Tag: 1.31.0-rc.0~4970 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=e32c90885748acd9f2b582a265cc485cd4da961f;p=lhc%2Fweb%2Fwiklou.git Merge "Use Database::addQuotes in Special:WantedPages/UnwatchedPages" --- e32c90885748acd9f2b582a265cc485cd4da961f diff --cc includes/specials/SpecialUnwatchedpages.php index 0cbf00d528,a4e96ae025..ae375b2d70 --- a/includes/specials/SpecialUnwatchedpages.php +++ b/includes/specials/SpecialUnwatchedpages.php @@@ -43,27 -43,8 +43,28 @@@ class UnwatchedpagesPage extends QueryP return false; } + /** + * Pre-cache page existence to speed up link generation + * + * @param IDatabase $db + * @param ResultWrapper $res + */ + public function preprocessResults( $db, $res ) { + if ( !$res->numRows() ) { + return; + } + + $batch = new LinkBatch(); + foreach ( $res as $row ) { + $batch->add( $row->namespace, $row->title ); + } + $batch->execute(); + + $res->seek( 0 ); + } + public function getQueryInfo() { + $dbr = wfGetDB( DB_REPLICA ); return [ 'tables' => [ 'page', 'watchlist' ], 'fields' => [