From 34a9db1d673f9498e0dbedc520ece0958328235c Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 27 Jan 2014 11:38:21 -0800 Subject: [PATCH] Put expensive info action count behind $wgMiserMode Change-Id: Ie0507b9ed62556f8caaaaf9499a4a40b3342b5af --- includes/actions/InfoAction.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index a424b9db7a..918fc9ed15 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -619,7 +619,7 @@ class InfoAction extends FormlessAction { * @return array */ protected static function pageCounts( Title $title ) { - global $wgRCMaxAge, $wgDisableCounters; + global $wgRCMaxAge, $wgDisableCounters, $wgMiserMode; wfProfileIn( __METHOD__ ); $id = $title->getArticleID(); @@ -723,15 +723,19 @@ class InfoAction extends FormlessAction { } // Counts for the number of transclusion links (to/from) - $result['transclusion']['to'] = (int)$dbr->selectField( - 'templatelinks', - 'COUNT(tl_from)', - array( - 'tl_namespace' => $title->getNamespace(), - 'tl_title' => $title->getDBkey() - ), - __METHOD__ - ); + if ( $wgMiserMode ) { + $result['transclusion']['to'] = 0; + } else { + $result['transclusion']['to'] = (int)$dbr->selectField( + 'templatelinks', + 'COUNT(tl_from)', + array( + 'tl_namespace' => $title->getNamespace(), + 'tl_title' => $title->getDBkey() + ), + __METHOD__ + ); + } $result['transclusion']['from'] = (int)$dbr->selectField( 'templatelinks', -- 2.20.1