From 26505b170adb24a6ae68945920db322c9382e470 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Thu, 13 Jan 2011 22:58:55 +0000 Subject: Fix concern raised by Brion in r74108 (but has really existed since the maintenance rewrite). Right now, including a maintenance script causes it to execute. This is bad when you want to reuse the particular class but not have it start executing all by itself. Until now, we relied on setting MW_NO_SETUP which was a) hacky, b) irreversable, and c) likely to be forgotten if you didn't use one of the wrappers like runChild(). Instead, move the freaky magic to doMaintenance and have *it* check if it's in a specific call stack that indicates this is being run from the file scope and should be executed. Rename DO_MAINTENANCE to RUN_MAINTENANCE_IF_MAIN so it's nice and clear what magic happens behind the require_once(). --- maintenance/checkBadRedirects.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'maintenance/checkBadRedirects.php') diff --git a/maintenance/checkBadRedirects.php b/maintenance/checkBadRedirects.php index c5d89a03df53..52bfa65acc5d 100644 --- a/maintenance/checkBadRedirects.php +++ b/maintenance/checkBadRedirects.php @@ -57,4 +57,4 @@ class CheckBadRedirects extends Maintenance { } $maintClass = "CheckBadRedirects"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); -- cgit v1.2.3