Fix concern raised by Brion in r74108 (but has really existed since the maintenance...
[lhc/web/wiklou.git] / maintenance / doMaintenance.php
index 59f5042..e930cc6 100644 (file)
  * @ingroup Maintenance
  */
 
-if ( !defined( 'DO_MAINTENANCE' ) ) {
+if ( !defined( 'RUN_MAINTENANCE_IF_MAIN' ) ) {
        echo "This file must be included after Maintenance.php\n";
        exit( 1 );
 }
 
+// Wasn't included from the file scope, halt execution (probably wanted the class)
+if( !Maintenance::shouldExecute() ) {
+       return;
+}
+
 if ( !$maintClass || !class_exists( $maintClass ) ) {
        echo "\$maintClass is not set or is set to a non-existent class.\n";
        exit( 1 );
 }
 
-if ( defined( 'MW_NO_SETUP' ) ) {
-       return;
-}
-
 // Get an object to start us off
 $maintenance = new $maintClass();