^_^ Can we get one for ParserFunctions and ParserTags then? If LanguageGetMagic loads on every load, then there might be reason to do the same.
We still have to load all the parserfunctions and tags ourself. And even worse we have to do it by calling on the parser and unstubbing it during load instead of letting it wait till it's actually unstubbed.
Actually... What I'm thinking is something like LanguageGetMagic. A hook, something like ParserGetHooks or whatever which passes the parser object into the function, and is used to add in all the hooks and tags to it. That also has the bonus side effect that if both parsers are being used instead of only one (ie: For things like ParserDiffTest) the parserfunctions are not excluded. Same goes for if for some odd reason an extension needs to initialize it's own Parser (Though, in that case there should probably be an option to disable loading of the pfuncs and tags).
~Daniel Friesen(Dantman) of: -The Gaiapedia (http://gaia.wikia.com) -Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) -and Wiki-Tools.com (http://wiki-tools.com)
Brion Vibber wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
DanTMan wrote:
extensions/ExtensionName/ExtensionName.php:
$wgHooks['LanguageGetMagic'][] = 'ExtensionName::LanguageGetMagic'; $wgExtensionFunctions[] = array( 'ExtensionName', 'ExtensionFunction' );
Oooh, avoid that last -- that'll load your class on every request, whether it's needed or not.
$wgExtensionFunctions is for initialization functions which will need to be run during Setup.php, after most of the basic infrastructure is up.
These days there's actually usually little if any need for such functions, since we've got the various hook arrays of all sorts which are designed for extensibility and lazy-loading; you can set your various information directly in the arrays in your config/loader code.
- -- brion vibber (brion @ wikimedia.org)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkg1ppMACgkQwRnhpk1wk45KkQCg2iSiouyAnhT7lYpdAmjkViVD WywAoNZ77bk3rTPe+0KKzou3yYn9QpzD =y7Nd -----END PGP SIGNATURE-----
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l