diff options
author | Chad Horohoe <demon@users.mediawiki.org> | 2011-01-13 22:58:55 +0000 |
---|---|---|
committer | Chad Horohoe <demon@users.mediawiki.org> | 2011-01-13 22:58:55 +0000 |
commit | 26505b170adb24a6ae68945920db322c9382e470 (patch) | |
tree | c3c1b704d10bbdbfcf96e2b0a6a0747fe12a0e2a /maintenance/getLagTimes.php | |
parent | 1979e95e7791d725756455827e759b76c072a07d (diff) | |
download | mediawikicore-26505b170adb24a6ae68945920db322c9382e470.tar.gz mediawikicore-26505b170adb24a6ae68945920db322c9382e470.zip |
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().
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/80205
Diffstat (limited to 'maintenance/getLagTimes.php')
-rw-r--r-- | maintenance/getLagTimes.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/maintenance/getLagTimes.php b/maintenance/getLagTimes.php index ab2c2aa1f9a3..0322fa2dc204 100644 --- a/maintenance/getLagTimes.php +++ b/maintenance/getLagTimes.php @@ -51,4 +51,4 @@ class GetLagTimes extends Maintenance { } $maintClass = "GetLagTimes"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); |