* @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();