* @defgroup Maintenance Maintenance
*/
-// Make sure we're on PHP5 or better
-if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
- require_once( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' );
- wfPHPVersionError( 'cli' );
-}
-
/**
* @defgroup MaintenanceArchive Maintenance archives
* @ingroup Maintenance
*/
// Define this so scripts can easily find doMaintenance.php
-define( 'RUN_MAINTENANCE_IF_MAIN', __DIR__ . '/doMaintenance.php' );
+define( 'RUN_MAINTENANCE_IF_MAIN', dirname( __FILE__ ) . '/doMaintenance.php' );
define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN ); // original name, harmless
$maintClass = false;
+// Make sure we're on PHP5 or better
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
+ require_once( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' );
+ wfPHPVersionError( 'cli' );
+}
/**
* Abstract maintenance class for quickly writing and churning out
global $IP;
$IP = strval( getenv( 'MW_INSTALL_PATH' ) ) !== ''
? getenv( 'MW_INSTALL_PATH' )
- : realpath( __DIR__ . '/..' );
+ : realpath( dirname( __FILE__ ) . '/..' );
$this->addDefaultParams();
register_shutdown_function( array( $this, 'outputChanneled' ), false );
* @return string
*/
protected function getDir() {
- return __DIR__;
+ return dirname( __FILE__ );
}
/**
protected static function getCoreScripts() {
if ( !self::$mCoreScripts ) {
$paths = array(
- __DIR__,
- __DIR__ . '/language',
- __DIR__ . '/storage',
+ dirname( __FILE__ ),
+ dirname( __FILE__ ) . '/language',
+ dirname( __FILE__ ) . '/storage',
);
self::$mCoreScripts = array();
foreach ( $paths as $p ) {