Add PPFrame::isVolatile and PPFrame::setVolatile
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 6 Dec 2013 23:28:09 +0000 (18:28 -0500)
committerJackmcbarn <jackmcbarn@gmail.com>
Fri, 30 May 2014 18:07:06 +0000 (14:07 -0400)
commitd18ba4e9dfe51e4689b510f954ba320bd21e3f32
treec4368bd7ea876bd56620b2afca15fb6cd565d011
parentedbb233e2565df6d8cb09e879e63bfed90e7d18c
Add PPFrame::isVolatile and PPFrame::setVolatile

Most wikitext is safe to parse once and then cache for when that same
wikitext is used again, such as for multiple transclusions of the same
template within a page. There are occasions, though, where some piece of
wikitext has side effects and so should not be cached; a prominent
example of such wikitext is the <ref> and <references> tags in Cite.php.

This change adds PPFrame::setVolatile so parser hooks such as <ref> and
<references> can indicate that they have done something that should not
be cached, and PPFrame::isVolatile so that callers of PPFrame::expand
can know when to avoid caching.

Bug: 46815
Bug: 31834
Change-Id: I95b3cf8781cf047cdb63da221cef45f3e7d1632e
RELEASE-NOTES-1.24
includes/api/ApiExpandTemplates.php
includes/parser/Parser.php
includes/parser/Preprocessor.php
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php