aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/getLagTimes.php
diff options
context:
space:
mode:
authorChad Horohoe <demon@users.mediawiki.org>2011-01-13 22:58:55 +0000
committerChad Horohoe <demon@users.mediawiki.org>2011-01-13 22:58:55 +0000
commit26505b170adb24a6ae68945920db322c9382e470 (patch)
treec3c1b704d10bbdbfcf96e2b0a6a0747fe12a0e2a /maintenance/getLagTimes.php
parent1979e95e7791d725756455827e759b76c072a07d (diff)
downloadmediawikicore-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.php2
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 );