From 8e5c1bc69f24a0a525ad8edc36c1f4daad65264d Mon Sep 17 00:00:00 2001 From: umherirrender Date: Fri, 8 Jun 2012 14:24:39 +0200 Subject: [PATCH] Add call to GenderCache in list=allpages Without this call, each user page can produce a query to get the gender state. Change-Id: I430c9922008cfea57b02da112087a7d52aeb4d23 --- includes/api/ApiQueryAllPages.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/api/ApiQueryAllPages.php b/includes/api/ApiQueryAllPages.php index cfc22ff9f1..dec3d8a484 100644 --- a/includes/api/ApiQueryAllPages.php +++ b/includes/api/ApiQueryAllPages.php @@ -165,6 +165,16 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase { $this->addOption( 'LIMIT', $limit + 1 ); $res = $this->select( __METHOD__ ); + //Get gender information + if( MWNamespace::hasGenderDistinction( $params['namespace'] ) ) { + $users = array(); + foreach ( $res as $row ) { + $users[] = $row->page_title; + } + GenderCache::singleton()->doQuery( $users, __METHOD__ ); + $res->rewind(); //reset + } + $count = 0; $result = $this->getResult(); foreach ( $res as $row ) { -- 2.20.1