(bug 32368) Add ParserCloned hook
authorBrad Jorsch <bjorsch@wikimedia.org>
Thu, 15 Nov 2012 00:05:24 +0000 (16:05 -0800)
committerBrad Jorsch <bjorsch@wikimedia.org>
Fri, 16 Nov 2012 16:27:13 +0000 (11:27 -0500)
commit7c9d6c0d10789364b62cacfdbaa37b941bda2872
tree21838cc2ef7f1a04bef8dafee3469c1ae5329d24
parentf9462fc7026dc691aa8f074d5604e31f8c760908
(bug 32368) Add ParserCloned hook

We store various bits of data as "expando" properties on the Parser
object, to pass information from one stage of the parser to another. If
the parser is cloned, however, we can run into trouble because two
different Parser objects are now manipulating the same extension data
structure; this often shows up when ParserClearState is called on one
clone and clears the state of the other as well.

Since a deep clone might be too expensive and still might be wrong in
some cases, it seems most useful to simply provide a ParserCloned hook
so extensions can just do The Right Thing.

Change-Id: Ieec65c908d71e89b9a66f83b9a626f842aadacbb
docs/hooks.txt
includes/parser/Parser.php