From: Aaron Schulz Date: Mon, 27 Jan 2014 19:38:21 +0000 (-0800) Subject: Put expensive info action count behind $wgMiserMode X-Git-Tag: 1.31.0-rc.0~17127 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=34a9db1d673f9498e0dbedc520ece0958328235c;p=lhc%2Fweb%2Fwiklou.git Put expensive info action count behind $wgMiserMode Change-Id: Ie0507b9ed62556f8caaaaf9499a4a40b3342b5af --- 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',