mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-15 02:24:07 +00:00
Rename hook subscriber
Swap global function for closure Change-Id: I41a17461546ac76e223db1c2dc5b2be1ff093af8
This commit is contained in:
parent
33ab38abe5
commit
13dfba4f9a
|
@ -480,7 +480,7 @@ class SyntaxHighlight_GeSHi {
|
|||
* @param $extensionTypes
|
||||
* @return bool
|
||||
*/
|
||||
public static function hSpecialVersion_GeSHi( &$extensionTypes ) {
|
||||
public static function extensionTypes( &$extensionTypes ) {
|
||||
global $wgExtensionCredits;
|
||||
self::initialise();
|
||||
$wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi']['version'] = GESHI_VERSION;
|
||||
|
|
|
@ -60,8 +60,7 @@ $wgAutoloadClasses['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.clas
|
|||
$wgAutoloadClasses['ResourceLoaderGeSHiModule'] = $dir . 'ResourceLoaderGeSHiModule.php';
|
||||
$wgAutoloadClasses['ResourceLoaderGeSHiLocalModule'] = $dir . 'ResourceLoaderGeSHiLocalModule.php';
|
||||
|
||||
$wgHooks['ParserFirstCallInit'][] = 'efSyntaxHighlight_GeSHiSetup';
|
||||
$wgHooks['ExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi';
|
||||
$wgHooks['ExtensionTypes'][] = 'SyntaxHighlight_GeSHi::extensionTypes';
|
||||
$wgHooks['ResourceLoaderRegisterModules'][] = 'SyntaxHighlight_GeSHi::resourceLoaderRegisterModules';
|
||||
|
||||
//if ( defined( 'MW_SUPPORTS_CONTENTHANDLER' ) ) {
|
||||
|
@ -72,7 +71,6 @@ $wgHooks['ResourceLoaderRegisterModules'][] = 'SyntaxHighlight_GeSHi::resourceLo
|
|||
$wgHooks['ShowRawCssJs'][] = 'SyntaxHighlight_GeSHi::viewHook';
|
||||
//}
|
||||
|
||||
|
||||
// Module to load MediaWiki:Geshi.css.
|
||||
$wgResourceModules['ext.geshi.local'] = array( 'class' => 'HighlightGeSHilocal' );
|
||||
// More modules are defined by SyntaxHighlight_GeSHi::resourceLoaderRegisterModules,
|
||||
|
@ -91,9 +89,10 @@ $wgSyntaxHighlightModels = array(
|
|||
* Register parser hook
|
||||
*
|
||||
* @param $parser Parser
|
||||
* @return bool
|
||||
*/
|
||||
function efSyntaxHighlight_GeSHiSetup( &$parser ) {
|
||||
$wgHooks['ParserFirstCallInit'][] = function ( &$parser ) {
|
||||
$parser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) );
|
||||
$parser->setHook( 'syntaxhighlight', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) );
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue