From 41ea7e2fefff6513af1ac7bf5a39bdc76552543b Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 23 Aug 2017 12:21:14 +1000 Subject: [PATCH] Split common pre-setup code out of WebStart/doMaintenance Introduce PreConfigSetup.php, which is common file-scope code run before LocalSettings.php. I'm not maintaining autoload.ide.php since it supports closed source software which I don't have, and it apparently needs significant work to make it not be weird and hacky. Change-Id: I44ac69b6b00a51d015546b9766d89d1c59749334 --- includes/PreConfigSetup.php | 54 +++++++++++++++++++++++++++++++++++ includes/WebStart.php | 26 +---------------- maintenance/doMaintenance.php | 21 +------------- 3 files changed, 56 insertions(+), 45 deletions(-) create mode 100644 includes/PreConfigSetup.php diff --git a/includes/PreConfigSetup.php b/includes/PreConfigSetup.php new file mode 100644 index 0000000000..bda78865b7 --- /dev/null +++ b/includes/PreConfigSetup.php @@ -0,0 +1,54 @@ +setup(); // to $maintenance->mSelf. Keep that here for b/c $self = $maintenance->getName(); -# Start the autoloader, so that extensions can derive classes from core files -require_once "$IP/includes/AutoLoader.php"; -# Grab profiling functions -require_once "$IP/includes/profiler/ProfilerFunctions.php"; - -# Start the profiler -$wgProfiler = []; -if ( file_exists( "$IP/StartProfiler.php" ) ) { - require "$IP/StartProfiler.php"; -} - -// Some other requires -require_once "$IP/includes/Defines.php"; -require_once "$IP/includes/DefaultSettings.php"; -require_once "$IP/includes/GlobalFunctions.php"; - -# Load composer's autoloader if present -if ( is_readable( "$IP/vendor/autoload.php" ) ) { - require_once "$IP/vendor/autoload.php"; -} +require_once "$IP/includes/PreConfigSetup.php"; if ( defined( 'MW_CONFIG_CALLBACK' ) ) { # Use a callback function to configure MediaWiki -- 2.20.1