Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354066 )

Change subject: EnhancedChangesList: Use one TemplateParser instance
......................................................................

EnhancedChangesList: Use one TemplateParser instance

TemplateParser has an instance cache to avoid reading from APC
repeatedly for the same template, but that only works if the code uses
the same TemplateParser object.

Noticed while investigating T163154.

Change-Id: I645895a0965f7150e9a5aebc5a7788f27aa5a26d
---
M includes/changes/EnhancedChangesList.php
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/66/354066/1

diff --git a/includes/changes/EnhancedChangesList.php 
b/includes/changes/EnhancedChangesList.php
index b8a2ac8..1a2da1a 100644
--- a/includes/changes/EnhancedChangesList.php
+++ b/includes/changes/EnhancedChangesList.php
@@ -33,6 +33,11 @@
        protected $rc_cache;
 
        /**
+        * @var TemplateParser
+        */
+       protected $templateParser;
+
+       /**
         * @param IContextSource|Skin $obj
         * @param array $filterGroups Array of ChangesListFilterGroup objects 
(currently optional)
         * @throws MWException
@@ -58,6 +63,7 @@
                        $this->message,
                        $this->linkRenderer
                );
+               $this->templateParser = new TemplateParser();
        }
 
        /**
@@ -340,8 +346,7 @@
 
                $this->rcCacheIndex++;
 
-               $templateParser = new TemplateParser();
-               return $templateParser->processTemplate(
+               return $this->templateParser->processTemplate(
                        'EnhancedChangesListGroup',
                        $templateParams
                );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I645895a0965f7150e9a5aebc5a7788f27aa5a26d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <lego...@member.fsf.org>

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

Reply via email to