Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/109710


Change subject: Put expensive info action count behind $wgMiserMode
......................................................................

Put expensive info action count behind $wgMiserMode

Change-Id: Ie0507b9ed62556f8caaaaf9499a4a40b3342b5af
---
M includes/actions/InfoAction.php
1 file changed, 14 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/10/109710/1

diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php
index a424b9d..918fc9e 100644
--- a/includes/actions/InfoAction.php
+++ b/includes/actions/InfoAction.php
@@ -619,7 +619,7 @@
         * @return array
         */
        protected static function pageCounts( Title $title ) {
-               global $wgRCMaxAge, $wgDisableCounters;
+               global $wgRCMaxAge, $wgDisableCounters, $wgMiserMode;
 
                wfProfileIn( __METHOD__ );
                $id = $title->getArticleID();
@@ -723,15 +723,19 @@
                }
 
                // 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',

-- 
To view, visit https://gerrit.wikimedia.org/r/109710
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0507b9ed62556f8caaaaf9499a4a40b3342b5af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to