Was it supposed to be a comma instead of dot? :)
[lhc/web/wiklou.git] / maintenance / doMaintenance.php
index 57e34fe..f13ca07 100644 (file)
@@ -31,10 +31,8 @@ if ( !defined( 'DO_MAINTENANCE' ) ) {
        exit( 1 );
 }
 
-error_reporting( E_ALL | E_STRICT );
-
 if( !$maintClass || !class_exists( $maintClass ) ) {
-       echo "\$maintClass is not set or is set to a non-existent class.";
+       echo "\$maintClass is not set or is set to a non-existent class.\n";
        exit( 1 );
 }
 
@@ -59,22 +57,23 @@ if ( file_exists( "$IP/StartProfiler.php" ) ) {
        require_once( "$IP/includes/ProfilerStub.php" );
 }
 
+// Some other requires
+require_once( "$IP/includes/AutoLoader.php" );
+require_once( "$IP/includes/Defines.php" );
+
 // Load settings, using wikimedia-mode if needed
-if( file_exists( dirname(__FILE__).'/wikimedia-mode' ) ) {
+// Fixme: replace this hack with general farm-friendly code
+if( file_exists( "$IP/wmf-config/wikimedia-mode" ) ) {
        # TODO FIXME! Wikimedia-specific stuff needs to go away to an ext
        # Maybe a hook?
        global $cluster;
        $wgWikiFarm = true;
        $cluster = 'pmtpa';
-       require_once( "$IP/includes/AutoLoader.php" );
        require_once( "$IP/includes/SiteConfiguration.php" );
-       require( "$IP/wgConf.php" );
+       require( "$IP/wmf-config/wgConf.php" );
        $maintenance->loadWikimediaSettings();
-       require( $IP.'/includes/Defines.php' );
-       require( $IP.'/CommonSettings.php' );
+       require( $IP.'/wmf-config/CommonSettings.php' );
 } else {
-       require_once( "$IP/includes/AutoLoader.php" );
-       require_once( "$IP/includes/Defines.php" );
        require_once( $maintenance->loadSettings() );
 }
 $maintenance->finalSetup();
@@ -88,9 +87,11 @@ $wgTitle = null;
 // Do the work
 try {
        $maintenance->execute();
+
+       // Potentially debug globals
+       $maintenance->globals();
 } catch( MWException $mwe ) {
        echo( $mwe->getText() );
+       exit( 1 );
 }
 
-// Potentially debug globals
-$maintenance->globals();