"Simetrical" Simetrical+wikilist@gmail.com wrote in message news:7c2a12e20805161159k7195ba79ld6a887c4c60a1a56@mail.gmail.com...
On Fri, May 16, 2008 at 2:54 PM, Jonathan Nowacki
jnowacki@gmail.com wrote:
I found setHook in Parser.php but $wgParser exists only once in an irrelevant comment. Doing a quick search showed that $wgParser is referenced up to 147 times on the standard media wiki distro. 56 of
those
lines show $wgParser preceded by a global declaration. It seems like
it's
locally defined yet in my script I'm unable to change the name. Any suggestions?
$wgParser is a global that's initialized during MediaWiki startup. It's an object of the Parser class, which is why you were told to look in Parser.php: that's where its methods are defined. You may want to look at docs/globals.txt for more info on what globals MediaWiki uses.
Or perhaps http://www.php.net/manual/en/language.variables.scope.php for an introduction to PHP globals and how they work. There seem to be a few areas of the PHP language that you don't yet understand fully, so I would recommend looking in the PHP manual first rather than trying to figure it out from the MediaWiki code-base, which (let's be honest) is not necessarily the ideal introduction to PHP... :-)
- Mark Clements (HappyDog)