protected static $mCoreScripts = null;
/**
- * Default constructor. Children should call this if implementing
+ * Default constructor. Children should call this *first* if implementing
* their own constructors
*/
public function __construct() {
+ // Setup $IP, using MW_INSTALL_PATH if it exists
+ global $IP;
+ $IP = strval( getenv( 'MW_INSTALL_PATH' ) ) !== ''
+ ? getenv( 'MW_INSTALL_PATH' )
+ : realpath( dirname( __FILE__ ) . '/..' );
+
$this->addDefaultParams();
register_shutdown_function( array( $this, 'outputChanneled' ), false );
}
* Do some sanity checking and basic setup
*/
public function setup() {
- global $IP, $wgCommandLineMode, $wgRequestTime;
+ global $wgCommandLineMode, $wgRequestTime;
# Abort if called from a web server
if ( isset( $_SERVER ) && isset( $_SERVER['REQUEST_METHOD'] ) ) {
# Define us as being in MediaWiki
define( 'MEDIAWIKI', true );
- # Setup $IP, using MW_INSTALL_PATH if it exists
- $IP = strval( getenv( 'MW_INSTALL_PATH' ) ) !== ''
- ? getenv( 'MW_INSTALL_PATH' )
- : realpath( dirname( __FILE__ ) . '/..' );
-
$wgCommandLineMode = true;
# Turn off output buffering if it's on
@ob_end_flush();