X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSiteStats.php;h=81172a14f7ac14b3543397e7c91ec1927ef02227;hb=1996e35ec7d4f1453162d3f1bdf5991448d9e968;hp=32c6761372f6eab961172035dcb5ea66e901ae8e;hpb=a56c35a226fea3a3548a0313ce8fb748cfeb3d5a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SiteStats.php b/includes/SiteStats.php index 32c6761372..81172a14f7 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -68,6 +68,8 @@ class SiteStats { * @return bool|ResultWrapper */ static function loadAndLazyInit() { + global $wgMiserMode; + wfDebug( __METHOD__ . ": reading site_stats from slave\n" ); $row = self::doLoad( wfGetDB( DB_SLAVE ) ); @@ -77,7 +79,7 @@ class SiteStats { $row = self::doLoad( wfGetDB( DB_MASTER ) ); } - if ( !self::isSane( $row ) ) { + if ( !$wgMiserMode && !self::isSane( $row ) ) { // Normally the site_stats table is initialized at install time. // Some manual construction scenarios may leave the table empty or // broken, however, for instance when importing from a dump into a @@ -221,7 +223,6 @@ class SiteStats { * @return int */ static function pagesInNs( $ns ) { - wfProfileIn( __METHOD__ ); if ( !isset( self::$pageCount[$ns] ) ) { $dbr = wfGetDB( DB_SLAVE ); self::$pageCount[$ns] = (int)$dbr->selectField( @@ -231,7 +232,6 @@ class SiteStats { __METHOD__ ); } - wfProfileOut( __METHOD__ ); return self::$pageCount[$ns]; }