From: Aaron Schulz Date: Thu, 11 Oct 2018 17:39:05 +0000 (-0700) Subject: Split out getSlotParserOutputUncached() method for the sake of profiling X-Git-Tag: 1.34.0-rc.0~3804 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=27e7791309b2e34d333903a121a6afbfe24b83ab;p=lhc%2Fweb%2Fwiklou.git Split out getSlotParserOutputUncached() method for the sake of profiling Change-Id: I553dba13486982b4530d290c84dc1f53b4df6ff9 --- diff --git a/includes/Revision/RenderedRevision.php b/includes/Revision/RenderedRevision.php index 9cb20e0c01..6eee3c4cf6 100644 --- a/includes/Revision/RenderedRevision.php +++ b/includes/Revision/RenderedRevision.php @@ -31,6 +31,7 @@ use Psr\Log\NullLogger; use Revision; use Title; use User; +use Content; use Wikimedia\Assert\Assert; /** @@ -207,12 +208,7 @@ class RenderedRevision implements SlotRenderingProvider { 'Access to the content has been suppressed for this audience' ); } else { - $output = $content->getParserOutput( - $this->title, - $this->revision->getId(), - $this->options, - $withHtml - ); + $output = $this->getSlotParserOutputUncached( $content, $withHtml ); if ( $withHtml && !$output->hasText() ) { throw new LogicException( @@ -232,6 +228,21 @@ class RenderedRevision implements SlotRenderingProvider { return $this->slotsOutput[$role]; } + /** + * @note This method exist to make duplicate parses easier to see during profiling + * @param Content $content + * @param bool $withHtml + * @return ParserOutput + */ + private function getSlotParserOutputUncached( Content $content, $withHtml ) { + return $content->getParserOutput( + $this->title, + $this->revision->getId(), + $this->options, + $withHtml + ); + } + /** * Updates the RevisionRecord after the revision has been saved. This can be used to discard * and cached ParserOutput so parser functions like {{REVISIONTIMESTAMP}} or {{REVISIONID}}