<?php
/**
- * Include most things that are needed to make %MediaWiki work.
+ * Include most things that are needed to make MediaWiki work.
*
* This file is included by WebStart.php and doMaintenance.php so that both
* web and maintenance scripts share a final set up phase to include necessary
$fname = 'Setup.php';
$ps_setup = Profiler::instance()->scopedProfileIn( $fname );
-// If any extensions are still queued, force load them
+// Load queued extensions
ExtensionRegistry::getInstance()->loadFromQueue();
+// Don't let any other extensions load
+ExtensionRegistry::getInstance()->finish();
// Check to see if we are at the file scope
if ( !isset( $wgVersion ) ) {
}
// Backwards compatibility warning
-if ( !$wgSessionsInObjectCache && !$wgSessionsInMemcached ) {
+if ( !$wgSessionsInObjectCache ) {
wfDeprecated( '$wgSessionsInObjectCache = false', '1.27' );
if ( $wgSessionHandler ) {
wfDeprecated( '$wgSessionsHandler', '1.27' );
MWDebug::init();
}
-if ( !class_exists( 'AutoLoader' ) ) {
- require_once "$IP/includes/AutoLoader.php";
-}
-
// Reset the global service locator, so any services that have already been created will be
// re-created while taking into account any custom settings and extensions.
MediaWikiServices::resetGlobalInstance( new GlobalVarConfig(), 'quick' );
+if ( $wgSharedDB && $wgSharedTables ) {
+ // Apply $wgSharedDB table aliases for the local LB (all non-foreign DB connections)
+ MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
+ array_fill_keys(
+ $wgSharedTables,
+ [
+ 'dbname' => $wgSharedDB,
+ 'schema' => $wgSharedSchema,
+ 'prefix' => $wgSharedPrefix
+ ]
+ )
+ );
+}
+
// Define a constant that indicates that the bootstrapping of the service locator
// is complete.
define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 );
// initialize the request object in $wgRequest
$wgRequest = RequestContext::getMain()->getRequest(); // BackCompat
+// Set user IP/agent information for causal consistency purposes
+MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [
+ 'IPAddress' => $wgRequest->getIP(),
+ 'UserAgent' => $wgRequest->getHeader( 'User-Agent' ),
+ 'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' )
+] );
// Useful debug output
if ( $wgCommandLineMode ) {
wfDebugLog( 'caches',
'cluster: ' . get_class( $wgMemc ) .
- ', WAN: ' . $wgMainWANCache .
+ ', WAN: ' . ( $wgMainWANCache === CACHE_NONE ? 'CACHE_NONE' : $wgMainWANCache ) .
', stash: ' . $wgMainStash .
', message: ' . get_class( $messageMemc ) .
', parser: ' . get_class( $parserMemc ) .
/**
* @var Parser $wgParser
*/
-$wgParser = new StubObject( 'wgParser', $wgParserConf['class'], [ $wgParserConf ] );
+$wgParser = new StubObject( 'wgParser', function () {
+ return MediaWikiServices::getInstance()->getParser();
+} );
/**
* @var Title $wgTitle
Pingback::schedulePingback();
}
-wfDebug( "Fully initialised\n" );
$wgFullyInitialised = true;
Profiler::instance()->scopedProfileOut( $ps_extensions );