From: Kunal Mehta Date: Tue, 16 May 2017 22:43:35 +0000 (-0700) Subject: EnhancedChangesList: Use one TemplateParser instance X-Git-Tag: 1.31.0-rc.0~3229^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=52a63f01b5a6d133e6f153ca12bda00058270aae;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/includes/changes/EnhancedChangesList.php b/includes/changes/EnhancedChangesList.php index b8a2ac8575..1a2da1a797 100644 --- a/includes/changes/EnhancedChangesList.php +++ b/includes/changes/EnhancedChangesList.php @@ -32,6 +32,11 @@ class EnhancedChangesList extends ChangesList { */ protected $rc_cache; + /** + * @var TemplateParser + */ + protected $templateParser; + /** * @param IContextSource|Skin $obj * @param array $filterGroups Array of ChangesListFilterGroup objects (currently optional) @@ -58,6 +63,7 @@ class EnhancedChangesList extends ChangesList { $this->message, $this->linkRenderer ); + $this->templateParser = new TemplateParser(); } /** @@ -340,8 +346,7 @@ class EnhancedChangesList extends ChangesList { $this->rcCacheIndex++; - $templateParser = new TemplateParser(); - return $templateParser->processTemplate( + return $this->templateParser->processTemplate( 'EnhancedChangesListGroup', $templateParams );