Last modified: 2008-08-28 09:21:41 UTC
I added a comment here: http://meta.wikimedia.org/wiki/Talk:ParserFunctions
but thought a patch that folks could review would be helpful.
In summary, the new MagicWords added by the extension are only available to the
global parser: $GLOBALS['wgParser']
In several extensions i use my own local parser so as to not muck up the global
variables which can have nasty side effects; however, parsing an article with a
local parser basically fails since the ParserFunctions MagicWords are not available.
Created attachment 2244 [details]
patch to allow ParserFunctions to work with other parser objects
You can clone $wgParser to produce an independent local parser with all the extensions
registered, this has the advantage of avoiding setup overhead.
That did not occur to me. I'll test that out. Thank you kindly.
Your suggestion is still a good one, and we may well implement something similar to it. My
only reservation is that extension registration is best done in firstCallInit() rather than
clearState(). That would require adding a new hook. Hook-based registration is better than
what we have now, but ideally I would like to have the registered extension list cached as
a whole, rather than initialised by running code from every extension on every web request.
Reopening; no indication of how this was fixed, and I see no relevant commits.
(In reply to comment #5)
> Reopening; no indication of how this was fixed, and I see no relevant commits.
Comment #2 'fixes' this.