The snippet of code you posted appears (to me) to be correct, but here are some things to check:
* Make sure nothing makes reference to accChecker() other than your extension setup function. That is, make sure no other hooks are calling it. Also make sure it's not being accidentally called elsewhere in the file or in LocalSettings.
* Editorially, maybe the tag is being used in a template which is being included in other pages? Or, maybe the tag is being used in an article in the MediaWiki namespace - causing it to be re-rendered on each page view.
-- Jim R. Wilson (jimbojw)
On 8/30/07, Christensen, Courtney ChristensenC@battelle.org wrote:
Hi List,
I develop extensions for MediaWiki at work. We are using IIS, PHP 5, current MySQL, and MediaWiki version 1.8 (I believe). I have an extension that is supposed to replace <accNumTag>SomeInfo</AccNumTag> with a wiki table. It does this correctly, however, it seems to be running through the extension on pages that do not contain the invoking tag (accNumTag). This is severely slowing down the load of the edit page.
I've added some print statements to figure out what is going on and it seems that $input is getting a value even on pages that do not contain <accNumTag>. I think if I understood how extensions are called better I might be able to puzzle this out? Does anyone have any suggestions or pointers to a good "how the parser hook works" page?
As far as I can see the code looks normal?
function wfAccChecker() { global $wgParser; $wgParser->setHook( "AccNumTag", "accChecker" ); }
function accChecker ($input, $argv) { if (isset($input)&& !empty($input)) { . . . . } }
Thank you! Courtney Christensen
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l