r53245 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53244‎ | r53245 | r53246 >
Date:17:30, 14 July 2009
Author:ialex
Status:deferred
Tags:
Comment:
Use ParserFirstCallInit hook if available
Modified paths:
  • /trunk/extensions/LiquidThreads/LiquidThreads.php (modified) (history)
  • /trunk/extensions/LiquidThreads/LqtFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/LqtFunctions.php
@@ -135,5 +135,6 @@
136136
137137 $wgParser->setFunctionHook( 'useliquidthreads',
138138 array( 'LqtParserFunctions', 'useLiquidThreads' ) );
 139+ return true;
139140 }
140141
Index: trunk/extensions/LiquidThreads/LiquidThreads.php
@@ -41,7 +41,11 @@
4242 $wgExtensionAliasesFiles['LiquidThreads'] = $dir . 'i18n/Lqt.alias.php';
4343
4444 // Parser Function Setup
45 -$wgExtensionFunctions[] = 'lqtSetupParserFunctions';
 45+if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
 46+ $wgHooks['ParserFirstCallInit'][] = 'lqtSetupParserFunctions';
 47+} else {
 48+ $wgExtensionFunctions[] = 'lqtSetupParserFunctions';
 49+}
4650
4751 // Hooks
4852 $wgHooks['SpecialWatchlistQuery'][] = 'efLqtBeforeWatchlistHook';

Status & tagging log