From: Kunal Mehta Date: Tue, 16 May 2017 22:49:03 +0000 (-0700) Subject: ContribsPager: Use one TemplateParser instance X-Git-Tag: 1.31.0-rc.0~3228^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=df487b2553d3b17566e9a169bcc889de84c99ea4;p=lhc%2Fweb%2Fwiklou.git ContribsPager: 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. Change-Id: I59e37306c5a3216cf8ed3bfef9c80d50934a9146 --- diff --git a/includes/specials/pagers/ContribsPager.php b/includes/specials/pagers/ContribsPager.php index 7d303de104..ea93f1f893 100644 --- a/includes/specials/pagers/ContribsPager.php +++ b/includes/specials/pagers/ContribsPager.php @@ -45,6 +45,11 @@ class ContribsPager extends ReverseChronologicalPager { */ protected $mParentLens; + /** + * @var TemplateParser + */ + protected $templateParser; + function __construct( IContextSource $context, array $options ) { parent::__construct( $context ); @@ -80,6 +85,7 @@ class ContribsPager extends ReverseChronologicalPager { // queries should use a regular replica DB since the lookup pattern is not all by user. $this->mDbSecondary = wfGetDB( DB_REPLICA ); // any random replica DB $this->mDb = wfGetDB( DB_REPLICA, 'contributions' ); + $this->templateParser = new TemplateParser(); } function getDefaultQuery() { @@ -516,8 +522,7 @@ class ContribsPager extends ReverseChronologicalPager { $this->msg( 'rev-deleted-user-contribs' )->escaped(); } - $templateParser = new TemplateParser(); - $ret = $templateParser->processTemplate( + $ret = $this->templateParser->processTemplate( 'SpecialContributionsLine', $templateParams );