X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=blobdiff_plain;f=includes%2Fparser%2FParser.php;h=0721446ba7be6d1195aaf409411465442c19f797;hb=3e74b6eeaaf4ad0ce1217d013cca09a3f07cb5c7;hp=4808cafe90bd95f23754e90d806b21aa0b7e7086;hpb=2e0cf0891444367942677692cf8efde87f19c3ef;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 4808cafe90..0721446ba7 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -205,9 +205,11 @@ class Parser { public $mLinkID; public $mIncludeSizes, $mPPNodeCount, $mGeneratedPPNodeCount, $mHighestExpansionDepth; public $mDefaultSort; - public $mTplRedirCache, $mTplDomCache, $mHeadings, $mDoubleUnderscores; + public $mTplRedirCache, $mHeadings, $mDoubleUnderscores; public $mExpensiveFunctionCount; # number of expensive parser function calls public $mShowToc, $mForceTocPosition; + /** @var array */ + public $mTplDomCache; /** * @var User @@ -3084,7 +3086,7 @@ class Parser { * self::OT_HTML: all templates and extension tags * * @param string $text The text to transform - * @param bool|PPFrame $frame Object describing the arguments passed to the + * @param false|PPFrame|array $frame Object describing the arguments passed to the * template. Arguments may also be provided as an associative array, as * was the usual case before MW1.12. Providing arguments this way may be * useful for extensions wishing to perform variable replacement @@ -3190,7 +3192,7 @@ class Parser { * $piece['lineStart']: whether the brace was at the start of a line * @param PPFrame $frame The current frame, contains template arguments * @throws Exception - * @return string The text of the template + * @return string|array The text of the template */ public function braceSubstitution( $piece, $frame ) { // Flags @@ -3691,6 +3693,18 @@ class Parser { return $this->currentRevisionCache->get( $cacheKey ); } + /** + * @param Title $title + * @return bool + * @since 1.34 + */ + public function isCurrentRevisionOfTitleCached( $title ) { + return ( + $this->currentRevisionCache && + $this->currentRevisionCache->has( $title->getPrefixedText() ) + ); + } + /** * Wrapper around Revision::newFromTitle to allow passing additional parameters * without passing them on to it. @@ -3725,8 +3739,7 @@ class Parser { foreach ( $stuff['deps'] as $dep ) { $this->mOutput->addTemplate( $dep['title'], $dep['page_id'], $dep['rev_id'] ); if ( $dep['title']->equals( $this->getTitle() ) ) { - // If we transclude ourselves, the final result - // will change based on the new version of the page + // Self-transclusion; final result may change based on the new page version $this->mOutput->setFlag( 'vary-revision' ); wfDebug( __METHOD__ . ": self transclusion, setting vary-revision" ); }