From: Hoo man Date: Tue, 28 Aug 2012 21:20:43 +0000 (+0200) Subject: Follow up to dirname( __FILE__ ) clean up X-Git-Tag: 1.31.0-rc.0~22558^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=d13c6fa96713caaac77e8d22866416f6b953379b;p=lhc%2Fweb%2Fwiklou.git Follow up to dirname( __FILE__ ) clean up 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 --- diff --git a/api.php b/api.php index ad420ff55a..7fae373102 100644 --- 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' ); } diff --git a/extensions/README b/extensions/README index e81028628a..66236e8514 100644 --- a/extensions/README +++ b/extensions/README @@ -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 ) { diff --git a/index.php b/index.php index 2ee17f81a4..0e9676da29 100644 --- 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' ); } diff --git a/load.php b/load.php index 6ffc14587e..f363c3fa51 100644 --- 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' ); } diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 6da5815504..69d113138a 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -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