r52642 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52641‎ | r52642 | r52643 >
Date:19:34, 1 July 2009
Author:shinjiman
Status:deferred
Tags:
Comment:
show the version information of GeSHi currently using, only show the version when Special:Version is loaded using the SpecialVersionExtensionTypes hook.
Link to r52546, r52550 and r52555 as there have some comments on CodeReview.
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
@@ -55,6 +55,7 @@
5656 $wgExtensionMessagesFiles['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.i18n.php';
5757 $wgAutoloadClasses['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.class.php';
5858 $wgHooks['ShowRawCssJs'][] = 'SyntaxHighlight_GeSHi::viewHook';
 59+$wgHooks['SpecialVersionExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi';
5960 if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
6061 $wgHooks['ParserFirstCallInit'][] = 'efSyntaxHighlight_GeSHiSetup';
6162 } else {
Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php
@@ -311,4 +311,14 @@
312312 }
313313 return true;
314314 }
 315+
 316+ /**
 317+ * Get the GeSHI's version information while Special:Version is read
 318+ */
 319+ public static function hSpecialVersion_GeSHi( &$sp, &$extensionTypes ) {
 320+ global $wgExtensionCredits;
 321+ require_once( 'geshi/geshi.php' );
 322+ $wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi']['version'] = GESHI_VERSION;
 323+ return true;
 324+ }
315325 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52546show the version information of GeSHi currently using, only show the version ...shinjiman15:07, 29 June 2009
r52550tweak for r52546, use require_once() to make the class file only load once.shinjiman16:29, 29 June 2009
r52555revert r52546 and r52550 for slow loading for the class, per CodeReview.shinjiman17:06, 29 June 2009

Status & tagging log