Follow up to dirname( __FILE__ ) clean up
authorHoo man <hoo@online.de>
Tue, 28 Aug 2012 21:20:43 +0000 (23:20 +0200)
committerHoo man <hoo@online.de>
Tue, 28 Aug 2012 21:47:56 +0000 (23:47 +0200)
Remove a trailing whitespace added by me in dirname( __FILE__ )
clean up and add some comments to the PHP version checks (they
can't use __DIR__ as they have to run in older PHP versions.

Change-Id: I6a7e8cb7dbf384d91dda4d0ecbef7ce588bc3073

api.php
extensions/README
index.php
load.php
maintenance/Maintenance.php

diff --git a/api.php b/api.php
index ad420ff..7fae373 100644 (file)
--- a/api.php
+++ b/api.php
@@ -35,6 +35,7 @@ define( 'MW_API', true );
 
 // Bail if PHP is too low
 if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
+       // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
        require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' );
        wfPHPVersionError( 'api.php' );
 }
index e810286..66236e8 100644 (file)
@@ -21,7 +21,7 @@ Please note that under POSIX systems (Linux...), parent of a symbolic path
 refers to the link source, NOT to the target! You should check the env
 variable MW_INSTALL_PATH in case the extension is not in the default location.
 
-The following code snippet lets you override the default path: 
+The following code snippet lets you override the default path:
 
  $IP = getenv( 'MW_INSTALL_PATH' );
  if( $IP === false ) {
index 2ee17f8..0e9676d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -41,6 +41,7 @@
 # PHP 4. Setup.php and ObjectCache.php have structures invalid in PHP 5.0 and
 # 5.1, respectively.
 if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
+       // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
        require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' );
        wfPHPVersionError( 'index.php' );
 }
index 6ffc145..f363c3f 100644 (file)
--- a/load.php
+++ b/load.php
@@ -24,6 +24,7 @@
 
 // Bail if PHP is too low
 if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
+       // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
        require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' );
        wfPHPVersionError( 'load.php' );
 }
index 6da5815..69d1131 100644 (file)
@@ -20,8 +20,9 @@
  * @defgroup Maintenance Maintenance
  */
 
-// Make sure we're on PHP5 or better
+// Make sure we're on PHP5.3.2 or better
 if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
+       // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
        require_once( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' );
        wfPHPVersionError( 'cli' );
 }
@@ -37,7 +38,6 @@ define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN ); // original name, harmless
 
 $maintClass = false;
 
-
 /**
  * Abstract maintenance class for quickly writing and churning out
  * maintenance scripts with minimal effort. All that _must_ be defined