From: Sam Reed Date: Wed, 25 May 2011 20:57:15 +0000 (+0000) Subject: We check self::$pageCount, then assign it to another array, and return it from that... X-Git-Tag: 1.31.0-rc.0~29941 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=542ee5844186f88f2892130f6be5678ff3129b09;p=lhc%2Fweb%2Fwiklou.git We check self::$pageCount, then assign it to another array, and return it from that array Not ever caching stuff further Follows up some ancient revisions --- diff --git a/includes/SiteStats.php b/includes/SiteStats.php index d66407b063..f0abd829ea 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -179,7 +179,7 @@ class SiteStats { wfProfileIn( __METHOD__ ); if( !isset( self::$pageCount[$ns] ) ) { $dbr = wfGetDB( DB_SLAVE ); - $pageCount[$ns] = (int)$dbr->selectField( + self::$pageCount[$ns] = (int)$dbr->selectField( 'page', 'COUNT(*)', array( 'page_namespace' => $ns ), @@ -187,7 +187,7 @@ class SiteStats { ); } wfProfileOut( __METHOD__ ); - return $pageCount[$ns]; + return self::$pageCount[$ns]; } /**