Index: trunk/phase3/maintenance/Maintenance.php |
— | — | @@ -102,10 +102,16 @@ |
103 | 103 | protected static $mCoreScripts = null; |
104 | 104 | |
105 | 105 | /** |
106 | | - * Default constructor. Children should call this if implementing |
| 106 | + * Default constructor. Children should call this *first* if implementing |
107 | 107 | * their own constructors |
108 | 108 | */ |
109 | 109 | public function __construct() { |
| 110 | + // Setup $IP, using MW_INSTALL_PATH if it exists |
| 111 | + global $IP; |
| 112 | + $IP = strval( getenv( 'MW_INSTALL_PATH' ) ) !== '' |
| 113 | + ? getenv( 'MW_INSTALL_PATH' ) |
| 114 | + : realpath( dirname( __FILE__ ) . '/..' ); |
| 115 | + |
110 | 116 | $this->addDefaultParams(); |
111 | 117 | register_shutdown_function( array( $this, 'outputChanneled' ), false ); |
112 | 118 | } |
— | — | @@ -415,7 +421,7 @@ |
416 | 422 | * Do some sanity checking and basic setup |
417 | 423 | */ |
418 | 424 | public function setup() { |
419 | | - global $IP, $wgCommandLineMode, $wgRequestTime; |
| 425 | + global $wgCommandLineMode, $wgRequestTime; |
420 | 426 | |
421 | 427 | # Abort if called from a web server |
422 | 428 | if ( isset( $_SERVER ) && isset( $_SERVER['REQUEST_METHOD'] ) ) { |
— | — | @@ -459,11 +465,6 @@ |
460 | 466 | # Define us as being in MediaWiki |
461 | 467 | define( 'MEDIAWIKI', true ); |
462 | 468 | |
463 | | - # Setup $IP, using MW_INSTALL_PATH if it exists |
464 | | - $IP = strval( getenv( 'MW_INSTALL_PATH' ) ) !== '' |
465 | | - ? getenv( 'MW_INSTALL_PATH' ) |
466 | | - : realpath( dirname( __FILE__ ) . '/..' ); |
467 | | - |
468 | 469 | $wgCommandLineMode = true; |
469 | 470 | # Turn off output buffering if it's on |
470 | 471 | @ob_end_flush(); |