From: Chad Horohoe Date: Thu, 13 Jan 2011 22:58:55 +0000 (+0000) Subject: Fix concern raised by Brion in r74108 (but has really existed since the maintenance... X-Git-Tag: 1.31.0-rc.0~32563 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=26505b170adb24a6ae68945920db322c9382e470;p=lhc%2Fweb%2Fwiklou.git 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(). --- diff --git a/docs/maintenance.txt b/docs/maintenance.txt index 039c71c53a..988ff28093 100644 --- a/docs/maintenance.txt +++ b/docs/maintenance.txt @@ -47,7 +47,7 @@ class DemoMaint extends Maintenance { } $maintClass = "DemoMaint"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); ==END== diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index badcc640cc..5bdfec5b0d 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -167,10 +167,6 @@ abstract class DatabaseUpdater { public function doUpdates( $purge = true ) { global $wgVersion; - if ( !defined( 'MW_NO_SETUP' ) ) { - define( 'MW_NO_SETUP', true ); - } - $this->runUpdates( $this->getCoreUpdateList(), false ); $this->runUpdates( $this->getOldGlobalUpdates(), false ); $this->runUpdates( $this->getExtensionUpdates(), true ); diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index d048b7b20c..df2c63cca4 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -21,7 +21,9 @@ */ // Define this so scripts can easily find doMaintenance.php -define( 'DO_MAINTENANCE', dirname( __FILE__ ) . '/doMaintenance.php' ); +define( 'RUN_MAINTENANCE_IF_MAIN', dirname( __FILE__ ) . '/doMaintenance.php' ); +define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN ); // original name, harmless + $maintClass = false; // Make sure we're on PHP5 or better @@ -116,6 +118,23 @@ abstract class Maintenance { register_shutdown_function( array( $this, 'outputChanneled' ), false ); } + /** + * Should we execute the maintenance script, or just allow it to be included + * as a standalone class? It checks that the call stack only includes this + * function and a require (meaning was called from the file scope) + * + * @return Boolean + */ + public static function shouldExecute() { + $bt = debug_backtrace(); + if( count( $bt ) !== 2 ) { + return false; + } + return $bt[1]['function'] == 'require_once' && + $bt[0]['class'] == 'Maintenance' && + $bt[0]['function'] == 'shouldExecute'; + } + /** * Do the actual work. All child classes will need to implement this */ @@ -389,10 +408,6 @@ abstract class Maintenance { * @return Maintenance child */ public function runChild( $maintClass, $classFile = null ) { - // If we haven't already specified, kill setup procedures - // for child scripts, we've already got a sane environment - self::disableSetup(); - // Make sure the class is loaded first if ( !class_exists( $maintClass ) ) { if ( $classFile ) { @@ -408,15 +423,6 @@ abstract class Maintenance { return $child; } - /** - * Disable Setup.php mostly - */ - protected static function disableSetup() { - if ( !defined( 'MW_NO_SETUP' ) ) { - define( 'MW_NO_SETUP', true ); - } - } - /** * Do some sanity checking and basic setup */ @@ -943,7 +949,6 @@ abstract class Maintenance { */ protected static function getCoreScripts() { if ( !self::$mCoreScripts ) { - self::disableSetup(); $paths = array( dirname( __FILE__ ), dirname( __FILE__ ) . '/gearman', diff --git a/maintenance/addwiki.php b/maintenance/addwiki.php index 7a0fa6f66d..53699f227a 100644 --- a/maintenance/addwiki.php +++ b/maintenance/addwiki.php @@ -464,4 +464,4 @@ EOT; } $maintClass = "AddWiki"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/attachLatest.php b/maintenance/attachLatest.php index 449b67f936..e6287f43a7 100644 --- a/maintenance/attachLatest.php +++ b/maintenance/attachLatest.php @@ -78,4 +78,4 @@ class AttachLatest extends Maintenance { } $maintClass = "AttachLatest"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/benchmarks/bench_HTTP_HTTPS.php b/maintenance/benchmarks/bench_HTTP_HTTPS.php index 5c37492641..0038b2d1f7 100644 --- a/maintenance/benchmarks/bench_HTTP_HTTPS.php +++ b/maintenance/benchmarks/bench_HTTP_HTTPS.php @@ -54,4 +54,4 @@ class bench_HTTP_HTTPS extends Benchmarker { } $maintClass = 'bench_HTTP_HTTPS'; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/benchmarks/bench_strtr_str_replace.php b/maintenance/benchmarks/bench_strtr_str_replace.php index 565f3a1896..ae576981fc 100644 --- a/maintenance/benchmarks/bench_strtr_str_replace.php +++ b/maintenance/benchmarks/bench_strtr_str_replace.php @@ -47,4 +47,4 @@ class bench_strtr_str_replace extends Benchmarker { } $maintClass = 'bench_strtr_str_replace'; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/benchmarks/bench_wfIsWindows.php b/maintenance/benchmarks/bench_wfIsWindows.php index 975f72af62..4c35221d71 100644 --- a/maintenance/benchmarks/bench_wfIsWindows.php +++ b/maintenance/benchmarks/bench_wfIsWindows.php @@ -58,4 +58,4 @@ class bench_wfIsWindows extends Benchmarker { } $maintClass = 'bench_wfIsWindows'; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/benchmarks/benchmarkPurge.php b/maintenance/benchmarks/benchmarkPurge.php index 7eaff8d35b..4ab7aa10e2 100644 --- a/maintenance/benchmarks/benchmarkPurge.php +++ b/maintenance/benchmarks/benchmarkPurge.php @@ -103,4 +103,4 @@ class BenchmarkPurge extends Benchmarker { } $maintClass = "BenchmarkPurge"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/changePassword.php b/maintenance/changePassword.php index a30645446b..568952b9e2 100644 --- a/maintenance/changePassword.php +++ b/maintenance/changePassword.php @@ -50,4 +50,4 @@ class ChangePassword extends Maintenance { } $maintClass = "ChangePassword"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/checkAutoLoader.php b/maintenance/checkAutoLoader.php index 9dc935e3ba..d199b6feae 100644 --- a/maintenance/checkAutoLoader.php +++ b/maintenance/checkAutoLoader.php @@ -55,4 +55,4 @@ class CheckAutoLoader extends Maintenance { } $maintClass = "CheckAutoLoader"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/checkBadRedirects.php b/maintenance/checkBadRedirects.php index c5d89a03df..52bfa65acc 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 ); diff --git a/maintenance/checkImages.php b/maintenance/checkImages.php index fa06461f85..96b93f22ba 100644 --- a/maintenance/checkImages.php +++ b/maintenance/checkImages.php @@ -80,4 +80,4 @@ class CheckImages extends Maintenance { } $maintClass = "CheckImages"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/checkSyntax.php b/maintenance/checkSyntax.php index e73dcfa8dd..396cac5fa9 100644 --- a/maintenance/checkSyntax.php +++ b/maintenance/checkSyntax.php @@ -295,5 +295,5 @@ class CheckSyntax extends Maintenance { } $maintClass = "CheckSyntax"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/checkUsernames.php b/maintenance/checkUsernames.php index 414d0983d0..b368432aca 100644 --- a/maintenance/checkUsernames.php +++ b/maintenance/checkUsernames.php @@ -52,4 +52,4 @@ class CheckUsernames extends Maintenance { } $maintClass = "CheckUsernames"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/cleanupCaps.php b/maintenance/cleanupCaps.php index 495bfce0ed..2d945a52c1 100644 --- a/maintenance/cleanupCaps.php +++ b/maintenance/cleanupCaps.php @@ -95,4 +95,4 @@ class CapsCleanup extends TableCleanup { } $maintClass = "CapsCleanup"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/cleanupImages.php b/maintenance/cleanupImages.php index 818b9ed2b6..b25b9bbe7d 100644 --- a/maintenance/cleanupImages.php +++ b/maintenance/cleanupImages.php @@ -204,4 +204,4 @@ class ImageCleanup extends TableCleanup { } $maintClass = "ImageCleanup"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/cleanupRemovedModules.php b/maintenance/cleanupRemovedModules.php index a9ee96816d..fb8afd2db6 100644 --- a/maintenance/cleanupRemovedModules.php +++ b/maintenance/cleanupRemovedModules.php @@ -86,4 +86,4 @@ class CleanupRemovedModules extends Maintenance { } $maintClass = "CleanupRemovedModules"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/cleanupSpam.php b/maintenance/cleanupSpam.php index ce3f72604c..8561281dd9 100644 --- a/maintenance/cleanupSpam.php +++ b/maintenance/cleanupSpam.php @@ -128,4 +128,4 @@ class CleanupSpam extends Maintenance { } $maintClass = "CleanupSpam"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/cleanupTitles.php b/maintenance/cleanupTitles.php index bb7aaa71f2..f03b79576b 100644 --- a/maintenance/cleanupTitles.php +++ b/maintenance/cleanupTitles.php @@ -152,4 +152,4 @@ class TitleCleanup extends TableCleanup { } $maintClass = "TitleCleanup"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/cleanupWatchlist.php b/maintenance/cleanupWatchlist.php index 8c85edf718..a9b20feab5 100644 --- a/maintenance/cleanupWatchlist.php +++ b/maintenance/cleanupWatchlist.php @@ -85,4 +85,4 @@ class WatchlistCleanup extends TableCleanup { } $maintClass = "WatchlistCleanup"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/clear_interwiki_cache.php b/maintenance/clear_interwiki_cache.php index c1fd417e1f..953bd4ce43 100644 --- a/maintenance/clear_interwiki_cache.php +++ b/maintenance/clear_interwiki_cache.php @@ -51,4 +51,4 @@ class ClearInterwikiCache extends Maintenance { } $maintClass = "ClearInterwikiCache"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/clear_stats.php b/maintenance/clear_stats.php index 4bd79a5629..8f91864ebd 100644 --- a/maintenance/clear_stats.php +++ b/maintenance/clear_stats.php @@ -51,4 +51,4 @@ class clear_stats extends Maintenance { } $maintClass = "clear_stats"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/commandLine.inc b/maintenance/commandLine.inc index 3228ab15e4..f57c0b67e5 100644 --- a/maintenance/commandLine.inc +++ b/maintenance/commandLine.inc @@ -61,5 +61,5 @@ class CommandLineInc extends Maintenance { } $maintClass = 'CommandLineInc'; -require( DO_MAINTENANCE ); +require( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/compareParsers.php b/maintenance/compareParsers.php index 87d00c68cc..069e55ecf0 100644 --- a/maintenance/compareParsers.php +++ b/maintenance/compareParsers.php @@ -191,4 +191,4 @@ class CompareParsers extends Maintenance { } $maintClass = "CompareParsers"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/convertLinks.php b/maintenance/convertLinks.php index d4c8cc26ff..85ef5c8c70 100644 --- a/maintenance/convertLinks.php +++ b/maintenance/convertLinks.php @@ -251,4 +251,4 @@ This gives a huge speed improvement for very large links tables which are MyISAM } $maintClass = "ConvertLinks"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/convertUserOptions.php b/maintenance/convertUserOptions.php index 2305443731..278d40ff30 100644 --- a/maintenance/convertUserOptions.php +++ b/maintenance/convertUserOptions.php @@ -70,4 +70,4 @@ class ConvertUserOptions extends Maintenance { } $maintClass = "ConvertUserOptions"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/createAndPromote.php b/maintenance/createAndPromote.php index d62e16acb4..8bff284a11 100644 --- a/maintenance/createAndPromote.php +++ b/maintenance/createAndPromote.php @@ -72,4 +72,4 @@ class CreateAndPromote extends Maintenance { } $maintClass = "CreateAndPromote"; -require_once( DO_MAINTENANCE ); \ No newline at end of file +require_once( RUN_MAINTENANCE_IF_MAIN ); \ No newline at end of file diff --git a/maintenance/deleteArchivedFiles.php b/maintenance/deleteArchivedFiles.php index 61da0dc9bf..6067c8077e 100644 --- a/maintenance/deleteArchivedFiles.php +++ b/maintenance/deleteArchivedFiles.php @@ -49,4 +49,4 @@ class DeleteArchivedFiles extends Maintenance { } $maintClass = "DeleteArchivedFiles"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/deleteArchivedRevisions.php b/maintenance/deleteArchivedRevisions.php index 0f77c53788..0faa0abbff 100644 --- a/maintenance/deleteArchivedRevisions.php +++ b/maintenance/deleteArchivedRevisions.php @@ -52,4 +52,4 @@ class DeleteArchivedRevisions extends Maintenance { } $maintClass = "DeleteArchivedRevisions"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/deleteBatch.php b/maintenance/deleteBatch.php index 9eb55a1cd4..c8bb4803c3 100644 --- a/maintenance/deleteBatch.php +++ b/maintenance/deleteBatch.php @@ -110,4 +110,4 @@ class DeleteBatch extends Maintenance { } $maintClass = "DeleteBatch"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/deleteDefaultMessages.php b/maintenance/deleteDefaultMessages.php index ca103623f4..fc482ac007 100644 --- a/maintenance/deleteDefaultMessages.php +++ b/maintenance/deleteDefaultMessages.php @@ -79,4 +79,4 @@ class DeleteDefaultMessages extends Maintenance { } $maintClass = "DeleteDefaultMessages"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/deleteImageMemcached.php b/maintenance/deleteImageMemcached.php index 2df582f0dc..007f0d17f6 100644 --- a/maintenance/deleteImageMemcached.php +++ b/maintenance/deleteImageMemcached.php @@ -72,4 +72,4 @@ class DeleteImageCache extends Maintenance { } $maintClass = "DeleteImageCache"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/deleteOldRevisions.php b/maintenance/deleteOldRevisions.php index 736a242e9d..ba76e9e9f8 100644 --- a/maintenance/deleteOldRevisions.php +++ b/maintenance/deleteOldRevisions.php @@ -97,5 +97,5 @@ class DeleteOldRevisions extends Maintenance { } $maintClass = "DeleteOldRevisions"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/deleteOrphanedRevisions.php b/maintenance/deleteOrphanedRevisions.php index 7b1235b097..e972d1fa12 100644 --- a/maintenance/deleteOrphanedRevisions.php +++ b/maintenance/deleteOrphanedRevisions.php @@ -85,5 +85,5 @@ class DeleteOrphanedRevisions extends Maintenance { } $maintClass = "DeleteOrphanedRevisions"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/deleteRevision.php b/maintenance/deleteRevision.php index 24fdbe41c1..5e8ecaacc1 100644 --- a/maintenance/deleteRevision.php +++ b/maintenance/deleteRevision.php @@ -78,4 +78,4 @@ class DeleteRevision extends Maintenance { } $maintClass = "DeleteRevision"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/deleteSelfExternals.php b/maintenance/deleteSelfExternals.php index 783a7ddb38..db23e92c88 100644 --- a/maintenance/deleteSelfExternals.php +++ b/maintenance/deleteSelfExternals.php @@ -51,4 +51,4 @@ class DeleteSelfExternals extends Maintenance { } $maintClass = "DeleteSelfExternals"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/doMaintenance.php b/maintenance/doMaintenance.php index 59f5042e14..e930cc6bb0 100644 --- a/maintenance/doMaintenance.php +++ b/maintenance/doMaintenance.php @@ -26,20 +26,21 @@ * @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(); diff --git a/maintenance/dumpInterwiki.php b/maintenance/dumpInterwiki.php index 3c690a9064..e92a3eac84 100644 --- a/maintenance/dumpInterwiki.php +++ b/maintenance/dumpInterwiki.php @@ -250,5 +250,5 @@ class DumpInterwiki extends Maintenance { } $maintClass = "DumpInterwiki"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/dumpLinks.php b/maintenance/dumpLinks.php index a6049d8627..39a9e955f8 100644 --- a/maintenance/dumpLinks.php +++ b/maintenance/dumpLinks.php @@ -69,5 +69,5 @@ class DumpLinks extends Maintenance { } $maintClass = "DumpLinks"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/dumpSisterSites.php b/maintenance/dumpSisterSites.php index ce931acd8d..f5abcd1b81 100644 --- a/maintenance/dumpSisterSites.php +++ b/maintenance/dumpSisterSites.php @@ -52,4 +52,4 @@ class DumpSisterSites extends Maintenance { } $maintClass = "DumpSisterSites"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/dumpUploads.php b/maintenance/dumpUploads.php index 0db4be3756..74c0cb0bc9 100644 --- a/maintenance/dumpUploads.php +++ b/maintenance/dumpUploads.php @@ -118,4 +118,4 @@ By default, outputs relative paths against the parent directory of \$wgUploadDir } $maintClass = "UploadDumper"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/edit.php b/maintenance/edit.php index 30dfee19aa..0e82426742 100644 --- a/maintenance/edit.php +++ b/maintenance/edit.php @@ -85,5 +85,5 @@ class EditCLI extends Maintenance { } $maintClass = "EditCLI"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/fetchText.php b/maintenance/fetchText.php index ed2778b7a2..ea56535def 100644 --- a/maintenance/fetchText.php +++ b/maintenance/fetchText.php @@ -81,4 +81,4 @@ class FetchText extends Maintenance { } $maintClass = "FetchText"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/findhooks.php b/maintenance/findhooks.php index 8ea00d15c0..28add4154f 100644 --- a/maintenance/findhooks.php +++ b/maintenance/findhooks.php @@ -211,4 +211,4 @@ class FindHooks extends Maintenance { } $maintClass = "FindHooks"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/fixSlaveDesync.php b/maintenance/fixSlaveDesync.php index 4320be5598..fe89294472 100644 --- a/maintenance/fixSlaveDesync.php +++ b/maintenance/fixSlaveDesync.php @@ -204,4 +204,4 @@ class FixSlaveDesync extends Maintenance { } $maintClass = "FixSlaveDesync"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/fixTimestamps.php b/maintenance/fixTimestamps.php index 0c1adbaef0..3e3bd0a50a 100644 --- a/maintenance/fixTimestamps.php +++ b/maintenance/fixTimestamps.php @@ -118,4 +118,4 @@ class FixTimestamps extends Maintenance { } $maintClass = "FixTimestamps"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/fixUserRegistration.php b/maintenance/fixUserRegistration.php index 8091c7a742..d4ff7c23a2 100644 --- a/maintenance/fixUserRegistration.php +++ b/maintenance/fixUserRegistration.php @@ -52,4 +52,4 @@ class FixUserRegistration extends Maintenance { } $maintClass = "FixUserRegistration"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php index f68b3aa343..a6527bd7f6 100644 --- a/maintenance/generateSitemap.php +++ b/maintenance/generateSitemap.php @@ -453,4 +453,4 @@ class GenerateSitemap extends Maintenance { } $maintClass = "GenerateSitemap"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/getLagTimes.php b/maintenance/getLagTimes.php index ab2c2aa1f9..0322fa2dc2 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 ); diff --git a/maintenance/getSlaveServer.php b/maintenance/getSlaveServer.php index 755659a140..a9d93f1dc1 100644 --- a/maintenance/getSlaveServer.php +++ b/maintenance/getSlaveServer.php @@ -47,4 +47,4 @@ class GetSlaveServer extends Maintenance { } $maintClass = "GetSlaveServer"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/getText.php b/maintenance/getText.php index b05c6f4ec9..eb04411722 100644 --- a/maintenance/getText.php +++ b/maintenance/getText.php @@ -55,4 +55,4 @@ class GetTextMaint extends Maintenance { } $maintClass = "GetTextMaint"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/httpSessionDownload.php b/maintenance/httpSessionDownload.php index 9b26fe1139..3c4f16a068 100644 --- a/maintenance/httpSessionDownload.php +++ b/maintenance/httpSessionDownload.php @@ -54,4 +54,4 @@ class HttpSessionDownload extends Maintenance { } $maintClass = "HttpSessionDownload"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/importUseModWikipedia.php b/maintenance/importUseModWikipedia.php index 618fbaec70..a14c4f4925 100644 --- a/maintenance/importUseModWikipedia.php +++ b/maintenance/importUseModWikipedia.php @@ -891,4 +891,4 @@ EOT } $maintClass = 'ImportUseModWikipedia'; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/initEditCount.php b/maintenance/initEditCount.php index 289315ddc8..e421e29bf8 100644 --- a/maintenance/initEditCount.php +++ b/maintenance/initEditCount.php @@ -107,4 +107,4 @@ in the load balancer, usually indicating a replication environment.' ); } $maintClass = "InitEditCount"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/initStats.php b/maintenance/initStats.php index 9dd27217a3..1ec5c92578 100644 --- a/maintenance/initStats.php +++ b/maintenance/initStats.php @@ -80,4 +80,4 @@ class InitStats extends Maintenance { } $maintClass = "InitStats"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/install.php b/maintenance/install.php index fb509cfe9d..09a7638764 100644 --- a/maintenance/install.php +++ b/maintenance/install.php @@ -90,4 +90,4 @@ class CommandLineInstaller extends Maintenance { $maintClass = "CommandLineInstaller"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/lag.php b/maintenance/lag.php index df1cf70971..dc8bff5f8c 100644 --- a/maintenance/lag.php +++ b/maintenance/lag.php @@ -63,4 +63,4 @@ class DatabaseLag extends Maintenance { } $maintClass = "DatabaseLag"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/language/alltrans.php b/maintenance/language/alltrans.php index d224e9f23e..f872e6a61a 100644 --- a/maintenance/language/alltrans.php +++ b/maintenance/language/alltrans.php @@ -37,4 +37,4 @@ class AllTrans extends Maintenance { } $maintClass = "AllTrans"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/language/countMessages.php b/maintenance/language/countMessages.php index a8a7f7ceba..f949ddc288 100644 --- a/maintenance/language/countMessages.php +++ b/maintenance/language/countMessages.php @@ -62,4 +62,4 @@ class CountMessages extends Maintenance { } $maintClass = "CountMessages"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/language/date-formats.php b/maintenance/language/date-formats.php index 32a923e0c8..04f5e8baf5 100644 --- a/maintenance/language/date-formats.php +++ b/maintenance/language/date-formats.php @@ -73,4 +73,4 @@ class DateFormats extends Maintenance { } $maintClass = "DateFormats"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/language/digit2html.php b/maintenance/language/digit2html.php index de99c369bb..a80ac01435 100644 --- a/maintenance/language/digit2html.php +++ b/maintenance/language/digit2html.php @@ -58,4 +58,4 @@ class Digit2Html extends Maintenance { } $maintClass = "Digit2Html"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/language/dumpMessages.php b/maintenance/language/dumpMessages.php index e676ce7d42..9bdda09d3b 100644 --- a/maintenance/language/dumpMessages.php +++ b/maintenance/language/dumpMessages.php @@ -43,4 +43,4 @@ class DumpMessages extends Maintenance { } $maintClass = "DumpMessages"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/language/generateNormalizerData.php b/maintenance/language/generateNormalizerData.php index be0b32747c..a958abf135 100644 --- a/maintenance/language/generateNormalizerData.php +++ b/maintenance/language/generateNormalizerData.php @@ -154,5 +154,5 @@ class GenerateNormalizerData extends Maintenance { } $maintClass = 'GenerateNormalizerData'; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/language/lang2po.php b/maintenance/language/lang2po.php index 7d1421e2fb..7e5dc4726a 100644 --- a/maintenance/language/lang2po.php +++ b/maintenance/language/lang2po.php @@ -163,4 +163,4 @@ msgstr "" } $maintClass = "Lang2Po"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/language/langmemusage.php b/maintenance/language/langmemusage.php index 40391cc140..28fe120e31 100644 --- a/maintenance/language/langmemusage.php +++ b/maintenance/language/langmemusage.php @@ -56,4 +56,4 @@ class LangMemUsage extends Maintenance { } $maintClass = "LangMemUsage"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/mctest.php b/maintenance/mctest.php index edc1d4a17d..651b2958ea 100644 --- a/maintenance/mctest.php +++ b/maintenance/mctest.php @@ -80,4 +80,4 @@ class mcTest extends Maintenance { } $maintClass = "mcTest"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/mergeMessageFileList.php b/maintenance/mergeMessageFileList.php index a914202218..994f9bbbd6 100644 --- a/maintenance/mergeMessageFileList.php +++ b/maintenance/mergeMessageFileList.php @@ -55,7 +55,7 @@ class MergeMessageFileList extends Maintenance { } } -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); foreach ( $mmfl['setupFiles'] as $fileName ) { if ( strval( $fileName ) === '' ) { diff --git a/maintenance/migrateUserGroup.php b/maintenance/migrateUserGroup.php index 4dfdad1507..c41632086f 100644 --- a/maintenance/migrateUserGroup.php +++ b/maintenance/migrateUserGroup.php @@ -67,4 +67,4 @@ class MigrateUserGroup extends Maintenance { } $maintClass = "MigrateUserGroup"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/minify.php b/maintenance/minify.php index 37818d63f6..e56e634954 100644 --- a/maintenance/minify.php +++ b/maintenance/minify.php @@ -128,4 +128,4 @@ class MinifyScript extends Maintenance { } $maintClass = 'MinifyScript'; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/moveBatch.php b/maintenance/moveBatch.php index 4bfe4a48bd..c749533841 100644 --- a/maintenance/moveBatch.php +++ b/maintenance/moveBatch.php @@ -107,4 +107,4 @@ class MoveBatch extends Maintenance { } $maintClass = "MoveBatch"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php index a9fa8c1508..dbb16bcd5c 100644 --- a/maintenance/namespaceDupes.php +++ b/maintenance/namespaceDupes.php @@ -307,4 +307,4 @@ class NamespaceConflictChecker extends Maintenance { } $maintClass = "NamespaceConflictChecker"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/nextJobDB.php b/maintenance/nextJobDB.php index 7f6aa40073..8d8229e257 100644 --- a/maintenance/nextJobDB.php +++ b/maintenance/nextJobDB.php @@ -100,4 +100,4 @@ class nextJobDB extends Maintenance { } $maintClass = "nextJobDb"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/nukeNS.php b/maintenance/nukeNS.php index 9de3a37baf..c89fa94bb0 100644 --- a/maintenance/nukeNS.php +++ b/maintenance/nukeNS.php @@ -111,4 +111,4 @@ class NukeNS extends Maintenance { } $maintClass = "NukeNS"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/nukePage.php b/maintenance/nukePage.php index 1057ea94a9..4a073a5e85 100644 --- a/maintenance/nukePage.php +++ b/maintenance/nukePage.php @@ -110,4 +110,4 @@ class NukePage extends Maintenance { } $maintClass = "NukePage"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/orphans.php b/maintenance/orphans.php index 46b9b27289..dbbddb9c46 100644 --- a/maintenance/orphans.php +++ b/maintenance/orphans.php @@ -231,4 +231,4 @@ class Orphans extends Maintenance { } $maintClass = "Orphans"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/patchSql.php b/maintenance/patchSql.php index 9c59d6adfe..1f96d62cc3 100644 --- a/maintenance/patchSql.php +++ b/maintenance/patchSql.php @@ -56,4 +56,4 @@ class PatchSql extends Maintenance { } $maintClass = "PatchSql"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/populateCategory.php b/maintenance/populateCategory.php index 71ba64508c..ce0765c9aa 100644 --- a/maintenance/populateCategory.php +++ b/maintenance/populateCategory.php @@ -141,4 +141,4 @@ TEXT; } $maintClass = "PopulateCategory"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/populateLogSearch.php b/maintenance/populateLogSearch.php index 32f5d194df..ce2d95ccf1 100644 --- a/maintenance/populateLogSearch.php +++ b/maintenance/populateLogSearch.php @@ -149,4 +149,4 @@ class PopulateLogSearch extends Maintenance { } $maintClass = "PopulateLogSearch"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/populateLogUsertext.php b/maintenance/populateLogUsertext.php index d3b1dd5cec..bb3927ce4f 100644 --- a/maintenance/populateLogUsertext.php +++ b/maintenance/populateLogUsertext.php @@ -78,5 +78,5 @@ class PopulateLogUsertext extends Maintenance { } $maintClass = "PopulateLogUsertext"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/populateParentId.php b/maintenance/populateParentId.php index 45255b020c..387f5a5603 100644 --- a/maintenance/populateParentId.php +++ b/maintenance/populateParentId.php @@ -115,4 +115,4 @@ class PopulateParentId extends Maintenance { } $maintClass = "PopulateParentId"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/populateRevisionLength.php b/maintenance/populateRevisionLength.php index faad442294..0af51dc113 100644 --- a/maintenance/populateRevisionLength.php +++ b/maintenance/populateRevisionLength.php @@ -95,4 +95,4 @@ class PopulateRevisionLength extends Maintenance { } $maintClass = "PopulateRevisionLength"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/populateSha1.php b/maintenance/populateSha1.php index 26764090e3..1714c0d64c 100644 --- a/maintenance/populateSha1.php +++ b/maintenance/populateSha1.php @@ -96,4 +96,4 @@ class PopulateSha1 extends Maintenance { } $maintClass = "PopulateSha1"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/protect.php b/maintenance/protect.php index 9143ad9eb4..aab84d6879 100644 --- a/maintenance/protect.php +++ b/maintenance/protect.php @@ -68,4 +68,4 @@ class Protect extends Maintenance { } $maintClass = "Protect"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/purgeList.php b/maintenance/purgeList.php index f5f89a17b3..2ae4b222ff 100644 --- a/maintenance/purgeList.php +++ b/maintenance/purgeList.php @@ -61,4 +61,4 @@ class PurgeList extends Maintenance { } $maintClass = "PurgeList"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/purgeOldText.php b/maintenance/purgeOldText.php index 4e2a927973..0cbc724e65 100644 --- a/maintenance/purgeOldText.php +++ b/maintenance/purgeOldText.php @@ -36,4 +36,4 @@ class PurgeOldText extends Maintenance { } $maintClass = "PurgeOldText"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/reassignEdits.php b/maintenance/reassignEdits.php index 100f4b9af8..039422b327 100644 --- a/maintenance/reassignEdits.php +++ b/maintenance/reassignEdits.php @@ -169,5 +169,5 @@ class ReassignEdits extends Maintenance { } $maintClass = "ReassignEdits"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/rebuildFileCache.php b/maintenance/rebuildFileCache.php index ff059d8502..841bbcda90 100644 --- a/maintenance/rebuildFileCache.php +++ b/maintenance/rebuildFileCache.php @@ -122,4 +122,4 @@ class RebuildFileCache extends Maintenance { } $maintClass = "RebuildFileCache"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/rebuildImages.php b/maintenance/rebuildImages.php index 8fbeb1cd24..1848b10401 100644 --- a/maintenance/rebuildImages.php +++ b/maintenance/rebuildImages.php @@ -209,4 +209,4 @@ class ImageBuilder extends Maintenance { } $maintClass = 'ImageBuilder'; -require( DO_MAINTENANCE ); +require( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/rebuildInterwiki.php b/maintenance/rebuildInterwiki.php index 5180a20aff..5bb4f4bb71 100644 --- a/maintenance/rebuildInterwiki.php +++ b/maintenance/rebuildInterwiki.php @@ -288,5 +288,5 @@ class RebuildInterwiki extends Maintenance { } $maintClass = "RebuildInterwiki"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php index 9733457138..0ca99610e9 100644 --- a/maintenance/rebuildLocalisationCache.php +++ b/maintenance/rebuildLocalisationCache.php @@ -130,4 +130,4 @@ class RebuildLocalisationCache extends Maintenance { } $maintClass = "RebuildLocalisationCache"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/rebuildall.php b/maintenance/rebuildall.php index 3d2aebc4bf..dbbed86d25 100644 --- a/maintenance/rebuildall.php +++ b/maintenance/rebuildall.php @@ -52,4 +52,4 @@ class RebuildAll extends Maintenance { } $maintClass = "RebuildAll"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/rebuildmessages.php b/maintenance/rebuildmessages.php index 335d534a2a..de37da7e47 100644 --- a/maintenance/rebuildmessages.php +++ b/maintenance/rebuildmessages.php @@ -47,4 +47,4 @@ class RebuildMessages extends Maintenance { } $maintClass = "RebuildMessages"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/rebuildrecentchanges.php b/maintenance/rebuildrecentchanges.php index 1f3e0a8ed0..8964d1a4ce 100644 --- a/maintenance/rebuildrecentchanges.php +++ b/maintenance/rebuildrecentchanges.php @@ -294,4 +294,4 @@ class RebuildRecentchanges extends Maintenance { } $maintClass = "RebuildRecentchanges"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/rebuildtextindex.php b/maintenance/rebuildtextindex.php index 6c400bdbe5..deabff737a 100644 --- a/maintenance/rebuildtextindex.php +++ b/maintenance/rebuildtextindex.php @@ -137,4 +137,4 @@ class RebuildTextIndex extends Maintenance { } $maintClass = "RebuildTextIndex"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/refreshImageCount.php b/maintenance/refreshImageCount.php index 2a1890d786..f9bdeea735 100644 --- a/maintenance/refreshImageCount.php +++ b/maintenance/refreshImageCount.php @@ -50,5 +50,5 @@ class RefreshImageCount extends Maintenance { } $maintClass = "RefreshImageCount"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php index 34fcbfbdf9..7c22644af1 100644 --- a/maintenance/refreshLinks.php +++ b/maintenance/refreshLinks.php @@ -279,4 +279,4 @@ class RefreshLinks extends Maintenance { } $maintClass = 'RefreshLinks'; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/removeUnusedAccounts.php b/maintenance/removeUnusedAccounts.php index 5be1b590ab..44c27b358e 100644 --- a/maintenance/removeUnusedAccounts.php +++ b/maintenance/removeUnusedAccounts.php @@ -107,4 +107,4 @@ class RemoveUnusedAccounts extends Maintenance { } $maintClass = "RemoveUnusedAccounts"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/renameDbPrefix.php b/maintenance/renameDbPrefix.php index adeb540dc5..dd09362322 100644 --- a/maintenance/renameDbPrefix.php +++ b/maintenance/renameDbPrefix.php @@ -84,4 +84,4 @@ class RenameDbPrefix extends Maintenance { } $maintClass = "RenameDbPrefix"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/renamewiki.php b/maintenance/renamewiki.php index 3cd5099960..338c45f0f9 100644 --- a/maintenance/renamewiki.php +++ b/maintenance/renamewiki.php @@ -86,4 +86,4 @@ class RenameWiki extends Maintenance { } $maintClass = "RenameWiki"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/renderDump.php b/maintenance/renderDump.php index 4eae473053..78c5b6f31e 100644 --- a/maintenance/renderDump.php +++ b/maintenance/renderDump.php @@ -115,4 +115,4 @@ class DumpRenderer extends Maintenance { } $maintClass = "DumpRenderer"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/rollbackEdits.php b/maintenance/rollbackEdits.php index 2be0566a2b..e1c126e1d6 100644 --- a/maintenance/rollbackEdits.php +++ b/maintenance/rollbackEdits.php @@ -94,4 +94,4 @@ class RollbackEdits extends Maintenance { } $maintClass = 'RollbackEdits'; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/runBatchedQuery.php b/maintenance/runBatchedQuery.php index 970b3924b0..dd3680c983 100644 --- a/maintenance/runBatchedQuery.php +++ b/maintenance/runBatchedQuery.php @@ -57,4 +57,4 @@ class BatchedQueryRunner extends Maintenance { $maintClass = "BatchedQueryRunner"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php index d4916c315c..a10003429e 100644 --- a/maintenance/runJobs.php +++ b/maintenance/runJobs.php @@ -122,4 +122,4 @@ class RunJobs extends Maintenance { } $maintClass = "RunJobs"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/showJobs.php b/maintenance/showJobs.php index 1a2dc42d60..886d7d45f7 100644 --- a/maintenance/showJobs.php +++ b/maintenance/showJobs.php @@ -52,4 +52,4 @@ class ShowJobs extends Maintenance { } $maintClass = "ShowJobs"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/showStats.php b/maintenance/showStats.php index 8daf507917..b5e8525e95 100644 --- a/maintenance/showStats.php +++ b/maintenance/showStats.php @@ -64,5 +64,5 @@ class ShowStats extends Maintenance { } $maintClass = "ShowStats"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/sql.php b/maintenance/sql.php index e601f88bbb..e1f2bb5f3e 100644 --- a/maintenance/sql.php +++ b/maintenance/sql.php @@ -90,4 +90,4 @@ class SqlPromptPrinter { } $maintClass = "MwSql"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/sqlite.php b/maintenance/sqlite.php index e46b8e77e6..4cd225d470 100644 --- a/maintenance/sqlite.php +++ b/maintenance/sqlite.php @@ -128,4 +128,4 @@ class SqliteMaintenance extends Maintenance { } $maintClass = "SqliteMaintenance"; -require_once( DO_MAINTENANCE ); \ No newline at end of file +require_once( RUN_MAINTENANCE_IF_MAIN ); \ No newline at end of file diff --git a/maintenance/stats.php b/maintenance/stats.php index 8854d19604..2cbbcf9199 100644 --- a/maintenance/stats.php +++ b/maintenance/stats.php @@ -87,4 +87,4 @@ class CacheStats extends Maintenance { } $maintClass = "CacheStats"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/storage/dumpRev.php b/maintenance/storage/dumpRev.php index db460b24d8..b200d8af03 100644 --- a/maintenance/storage/dumpRev.php +++ b/maintenance/storage/dumpRev.php @@ -76,4 +76,4 @@ class DumpRev extends Maintenance { } $maintClass = "DumpRev"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/storage/fixBug20757.php b/maintenance/storage/fixBug20757.php index 958294955e..d04a24ffd1 100644 --- a/maintenance/storage/fixBug20757.php +++ b/maintenance/storage/fixBug20757.php @@ -340,5 +340,5 @@ class FixBug20757 extends Maintenance { } $maintClass = 'FixBug20757'; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/storage/orphanStats.php b/maintenance/storage/orphanStats.php index 55677e84b7..f30f07e424 100644 --- a/maintenance/storage/orphanStats.php +++ b/maintenance/storage/orphanStats.php @@ -67,4 +67,4 @@ class OrphanStats extends Maintenance { } $maintClass = "OrphanStats"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/storage/storageTypeStats.php b/maintenance/storage/storageTypeStats.php index dfa8f516ef..817659fc8a 100644 --- a/maintenance/storage/storageTypeStats.php +++ b/maintenance/storage/storageTypeStats.php @@ -112,5 +112,5 @@ SQL; } $maintClass = 'StorageTypeStats'; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/undelete.php b/maintenance/undelete.php index 721ef075ba..f7ea2a296f 100644 --- a/maintenance/undelete.php +++ b/maintenance/undelete.php @@ -52,4 +52,4 @@ class Undelete extends Maintenance { } $maintClass = "Undelete"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/update.php b/maintenance/update.php index 4cb2194494..9c42b44e9d 100644 --- a/maintenance/update.php +++ b/maintenance/update.php @@ -131,4 +131,4 @@ class UpdateMediaWiki extends Maintenance { } $maintClass = 'UpdateMediaWiki'; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/updateArticleCount.php b/maintenance/updateArticleCount.php index 636d9fc746..b0dceb58ae 100644 --- a/maintenance/updateArticleCount.php +++ b/maintenance/updateArticleCount.php @@ -98,4 +98,4 @@ class UpdateArticleCount extends Maintenance { } $maintClass = "UpdateArticleCount"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/updateCollation.php b/maintenance/updateCollation.php index 0a173cd33a..67b6b1002a 100644 --- a/maintenance/updateCollation.php +++ b/maintenance/updateCollation.php @@ -125,4 +125,4 @@ TEXT; } $maintClass = "UpdateCollation"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/updateDoubleWidthSearch.php b/maintenance/updateDoubleWidthSearch.php index b18788061d..61545f8df2 100644 --- a/maintenance/updateDoubleWidthSearch.php +++ b/maintenance/updateDoubleWidthSearch.php @@ -67,4 +67,4 @@ class UpdateDoubleWidthSearch extends Maintenance { } $maintClass = "UpdateDoubleWidthSearch"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/updateRestrictions.php b/maintenance/updateRestrictions.php index 23d8aa28f2..c815f4b930 100644 --- a/maintenance/updateRestrictions.php +++ b/maintenance/updateRestrictions.php @@ -108,4 +108,4 @@ class UpdateRestrictions extends Maintenance { } $maintClass = "UpdateRestrictions"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/updateSearchIndex.php b/maintenance/updateSearchIndex.php index 6de3ced626..c73b46562c 100644 --- a/maintenance/updateSearchIndex.php +++ b/maintenance/updateSearchIndex.php @@ -119,4 +119,4 @@ class UpdateSearchIndex extends Maintenance { } $maintClass = "UpdateSearchIndex"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/updateSpecialPages.php b/maintenance/updateSpecialPages.php index 5d6c3f5fcd..335a2b20e9 100644 --- a/maintenance/updateSpecialPages.php +++ b/maintenance/updateSpecialPages.php @@ -140,4 +140,4 @@ class UpdateSpecialPages extends Maintenance { } $maintClass = "UpdateSpecialPages"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/upgrade1_5.php b/maintenance/upgrade1_5.php index 0b2836c386..22fab70896 100644 --- a/maintenance/upgrade1_5.php +++ b/maintenance/upgrade1_5.php @@ -1325,4 +1325,4 @@ END } $maintClass = 'FiveUpgrade'; -require( DO_MAINTENANCE ); +require( RUN_MAINTENANCE_IF_MAIN ); diff --git a/maintenance/waitForSlave.php b/maintenance/waitForSlave.php index 40a4bd7dc0..720ca288b6 100644 --- a/maintenance/waitForSlave.php +++ b/maintenance/waitForSlave.php @@ -34,4 +34,4 @@ class WaitForSlave extends Maintenance { } $maintClass = "WaitForSlave"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/tests/RunSeleniumTests.php b/tests/RunSeleniumTests.php index ffa14db7eb..e9270a8909 100644 --- a/tests/RunSeleniumTests.php +++ b/tests/RunSeleniumTests.php @@ -230,4 +230,4 @@ class SeleniumTester extends Maintenance { $maintClass = "SeleniumTester"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN );