r52550 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52549‎ | r52550 | r52551 >
Date:16:29, 29 June 2009
Author:shinjiman
Status:reverted (Comments)
Tags:
Comment:
tweak for r52546, use require_once() to make the class file only load once.
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
@@ -62,7 +62,7 @@
6363 }
6464
6565 if ( file_exists( $dir . 'geshi/geshi.php' ) ) {
66 - require( 'geshi/geshi.php' );
 66+ require_once( 'geshi/geshi.php' );
6767 $wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi']['version'] = GESHI_VERSION;
6868 }
6969
Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php
@@ -306,7 +306,7 @@
307307 if( !self::$initialised ) {
308308 wfLoadExtensionMessages( 'SyntaxHighlight_GeSHi' );
309309 if( !class_exists( 'GeSHi' ) )
310 - require( 'geshi/geshi.php' );
 310+ require_once( 'geshi/geshi.php' );
311311 self::$initialised = true;
312312 }
313313 return true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r52555revert r52546 and r52550 for slow loading for the class, per CodeReview.shinjiman17:06, 29 June 2009
r52642show the version information of GeSHi currently using, only show the version ...shinjiman19:34, 1 July 2009

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

Comments

#Comment by Tim Starling (talk | contribs)   16:59, 29 June 2009

Revert per r52546. require_once() is not needed inside the if(class_exists(...)) because if the class is loaded there is no need to load the file again. We use require() in cases like these because it is faster than require_once().

#Comment by Shinjiman (talk | contribs)   17:07, 29 June 2009

Reverted on r52555.

Status & tagging log