mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-15 02:24:07 +00:00
Set Geshi version in main php file
The version was set from the ExtensionTypes hook (which runs only on Special:Version). WikiApiary and other API consumers were unable to detect the version. This is an amended resubmission of the revertedd69ae1f3ac
, in which the constant was declared twice. Change include_once to require_once for langs file (follows-up168e1296
). Bug: T75666 Change-Id: I836e0df942a066d80255c1b68472e7ee58124357
This commit is contained in:
parent
f7a3487f56
commit
966ed89270
|
@ -501,18 +501,6 @@ class SyntaxHighlight_GeSHi {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the GeSHI's version information while Special:Version is read.
|
||||
* @param $extensionTypes
|
||||
* @return bool
|
||||
*/
|
||||
public static function extensionTypes( &$extensionTypes ) {
|
||||
global $wgExtensionCredits;
|
||||
self::initialise();
|
||||
$wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi']['version'] = GESHI_VERSION;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a ResourceLoader module providing styles for each supported language.
|
||||
*
|
||||
|
|
|
@ -40,14 +40,16 @@ if ( version_compare( $wgVersion, '1.24', '<' ) ) {
|
|||
die( "This version of SyntaxHighlight GeSHi requires MediaWiki 1.24" );
|
||||
}
|
||||
|
||||
include_once __DIR__ . '/SyntaxHighlight_GeSHi.langs.php';
|
||||
require_once __DIR__ . '/SyntaxHighlight_GeSHi.langs.php';
|
||||
require_once __DIR__ . '/geshi/geshi.php';
|
||||
|
||||
$wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi'] = array(
|
||||
$wgExtensionCredits['parserhook'][] = array(
|
||||
'path' => __FILE__,
|
||||
'name' => 'SyntaxHighlight',
|
||||
'author' => array( 'Brion Vibber', 'Tim Starling', 'Rob Church', 'Niklas Laxström' ),
|
||||
'descriptionmsg' => 'syntaxhighlight-desc',
|
||||
'url' => 'https://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi',
|
||||
'version' => GESHI_VERSION,
|
||||
);
|
||||
|
||||
// Change these in LocalSettings.php
|
||||
|
@ -62,7 +64,6 @@ $wgAutoloadClasses['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.clas
|
|||
$wgAutoloadClasses['ResourceLoaderGeSHiModule'] = $dir . 'ResourceLoaderGeSHiModule.php';
|
||||
$wgAutoloadClasses['ResourceLoaderGeSHiLocalModule'] = $dir . 'ResourceLoaderGeSHiLocalModule.php';
|
||||
|
||||
$wgHooks['ExtensionTypes'][] = 'SyntaxHighlight_GeSHi::extensionTypes';
|
||||
$wgHooks['ResourceLoaderRegisterModules'][] = 'SyntaxHighlight_GeSHi::resourceLoaderRegisterModules';
|
||||
$wgHooks['ContentGetParserOutput'][] = 'SyntaxHighlight_GeSHi::renderHook';
|
||||
$wgHooks['ApiFormatHighlight'][] = 'SyntaxHighlight_GeSHi::apiFormatHighlight';
|
||||
|
|
Loading…
Reference in a new issue