Rename hook subscriber

Swap global function for closure

Change-Id: I41a17461546ac76e223db1c2dc5b2be1ff093af8
This commit is contained in:
Reedy 2014-06-01 18:40:09 +01:00 committed by Legoktm
parent 33ab38abe5
commit 13dfba4f9a
2 changed files with 5 additions and 6 deletions

View file

@ -480,7 +480,7 @@ class SyntaxHighlight_GeSHi {
* @param $extensionTypes * @param $extensionTypes
* @return bool * @return bool
*/ */
public static function hSpecialVersion_GeSHi( &$extensionTypes ) { public static function extensionTypes( &$extensionTypes ) {
global $wgExtensionCredits; global $wgExtensionCredits;
self::initialise(); self::initialise();
$wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi']['version'] = GESHI_VERSION; $wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi']['version'] = GESHI_VERSION;

View file

@ -60,8 +60,7 @@ $wgAutoloadClasses['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.clas
$wgAutoloadClasses['ResourceLoaderGeSHiModule'] = $dir . 'ResourceLoaderGeSHiModule.php'; $wgAutoloadClasses['ResourceLoaderGeSHiModule'] = $dir . 'ResourceLoaderGeSHiModule.php';
$wgAutoloadClasses['ResourceLoaderGeSHiLocalModule'] = $dir . 'ResourceLoaderGeSHiLocalModule.php'; $wgAutoloadClasses['ResourceLoaderGeSHiLocalModule'] = $dir . 'ResourceLoaderGeSHiLocalModule.php';
$wgHooks['ParserFirstCallInit'][] = 'efSyntaxHighlight_GeSHiSetup'; $wgHooks['ExtensionTypes'][] = 'SyntaxHighlight_GeSHi::extensionTypes';
$wgHooks['ExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi';
$wgHooks['ResourceLoaderRegisterModules'][] = 'SyntaxHighlight_GeSHi::resourceLoaderRegisterModules'; $wgHooks['ResourceLoaderRegisterModules'][] = 'SyntaxHighlight_GeSHi::resourceLoaderRegisterModules';
//if ( defined( 'MW_SUPPORTS_CONTENTHANDLER' ) ) { //if ( defined( 'MW_SUPPORTS_CONTENTHANDLER' ) ) {
@ -72,7 +71,6 @@ $wgHooks['ResourceLoaderRegisterModules'][] = 'SyntaxHighlight_GeSHi::resourceLo
$wgHooks['ShowRawCssJs'][] = 'SyntaxHighlight_GeSHi::viewHook'; $wgHooks['ShowRawCssJs'][] = 'SyntaxHighlight_GeSHi::viewHook';
//} //}
// Module to load MediaWiki:Geshi.css. // Module to load MediaWiki:Geshi.css.
$wgResourceModules['ext.geshi.local'] = array( 'class' => 'HighlightGeSHilocal' ); $wgResourceModules['ext.geshi.local'] = array( 'class' => 'HighlightGeSHilocal' );
// More modules are defined by SyntaxHighlight_GeSHi::resourceLoaderRegisterModules, // More modules are defined by SyntaxHighlight_GeSHi::resourceLoaderRegisterModules,
@ -91,9 +89,10 @@ $wgSyntaxHighlightModels = array(
* Register parser hook * Register parser hook
* *
* @param $parser Parser * @param $parser Parser
* @return bool
*/ */
function efSyntaxHighlight_GeSHiSetup( &$parser ) { $wgHooks['ParserFirstCallInit'][] = function ( &$parser ) {
$parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) ); $parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) );
$parser->setHook( 'syntaxhighlight', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) ); $parser->setHook( 'syntaxhighlight', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) );
return true; return true;
} };