r70743 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70742‎ | r70743 | r70744 >
Date:06:25, 9 August 2010
Author:jeroendedauw
Status:ok
Tags:
Comment:
Follow up to r70741
Modified paths:
  • /trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php (modified) (history)
  • /trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php
@@ -52,9 +52,17 @@
5353 $wgExtensionMessagesFiles['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.i18n.php';
5454 $wgAutoloadClasses['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.class.php';
5555 $wgHooks['ShowRawCssJs'][] = 'SyntaxHighlight_GeSHi::viewHook';
56 -$wgHooks['SpecialVersionExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi';
5756 $wgHooks['ParserFirstCallInit'][] = 'efSyntaxHighlight_GeSHiSetup';
5857
 58+if ( version_compare( $wgVersion, '1.17alpha', '>=' ) ) {
 59+ // For MediaWiki 1.17 alpha and later.
 60+ $wgHooks['ExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi';
 61+}
 62+else {
 63+ // For pre-MediaWiki 1.17 alpha.
 64+ $wgHooks['SpecialVersionExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hOldSpecialVersion_GeSHi';
 65+}
 66+
5967 /**
6068 * Register parser hook
6169 */
Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php
@@ -313,12 +313,20 @@
314314 }
315315
316316 /**
317 - * Get the GeSHI's version information while Special:Version is read
 317+ * Get the GeSHI's version information while Special:Version is read.
318318 */
319 - public static function hSpecialVersion_GeSHi( &$sp, &$extensionTypes ) {
 319+ public static function hSpecialVersion_GeSHi( &$extensionTypes ) {
320320 global $wgExtensionCredits;
321321 self::initialise();
322322 $wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi']['version'] = GESHI_VERSION;
323323 return true;
324324 }
325 -}
 325+
 326+ /**
 327+ * @see SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi
 328+ */
 329+ public static function hOldSpecialVersion_GeSHi( &$sp, &$extensionTypes ) {
 330+ return self::hSpecialVersion_GeSHi( $extensionTypes );
 331+ }
 332+
 333+}
\ No newline at end of file

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70741Added ExtensionTypes hook that can be called from static context and deprecat...jeroendedauw06:16, 9 August 2010

Status & tagging log