r83379 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83378‎ | r83379 | r83380 >
Date:11:29, 6 March 2011
Author:tbleher
Status:ok
Tags:
Comment:
Use ParserFirstCallInit hook to avoid unstubbing the parser unnecessarily
Modified paths:
  • /trunk/extensions/SubPageList3/SubPageList3.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SubPageList3/SubPageList3.php
@@ -16,7 +16,7 @@
1717 die( 1 );
1818 }
1919
20 -$wgExtensionFunctions[] = 'efSubpageList3';
 20+$wgHooks['ParserFirstCallInit'][] = 'efSubpageList3';
2121 $wgExtensionCredits['parserhook'][] = array(
2222 'path' => __FILE__,
2323 'name' => 'Subpage List 3',
@@ -36,9 +36,9 @@
3737 /**
3838 * Hook in function
3939 */
40 -function efSubpageList3() {
41 - global $wgParser;
42 - $wgParser->setHook( 'splist', 'efRenderSubpageList3' );
 40+function efSubpageList3( &$parser ) {
 41+ $parser->setHook( 'splist', 'efRenderSubpageList3' );
 42+ return true;
4343 }
4444
4545 /**

Status & tagging log