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
This commit is contained in:
parent
4ef471fc31
commit
d13c6fa967
5 changed files with 6 additions and 3 deletions
1
api.php
1
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' );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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' );
|
||||
}
|
||||
|
|
|
|||
1
load.php
1
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' );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue