X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FSetup.php;h=f6631eadb91fb4361d1d344c238819dc297ca0f4;hp=357c76d8d114bd01fd5585fcf47fcd029daaf543;hb=bdfa96eb726c9997a010f5a194eec71925bfddc2;hpb=1f83b424294a6fd78cb73cf43db3464ca7481774 diff --git a/includes/Setup.php b/includes/Setup.php index 357c76d8d1..e686cd81d6 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -1,6 +1,6 @@ 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 ) ) { @@ -242,7 +244,7 @@ if ( $wgUseInstantCommons ) { 'transformVia404' => true, 'fetchDescription' => true, 'descriptionCacheExpiry' => 43200, - 'apiThumbCacheExpiry' => 86400, + 'apiThumbCacheExpiry' => 0, ]; } /* @@ -327,7 +329,7 @@ if ( $wgEnableEmail ) { $wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist; } else { // Disable all other email settings automatically if $wgEnableEmail - // is set to false. - bug 63678 + // is set to false. - T65678 $wgAllowHTMLEmail = false; $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway $wgEnableUserEmail = false; @@ -401,6 +403,14 @@ if ( is_array( $wgExtraNamespaces ) ) { $wgCanonicalNamespaceNames = $wgCanonicalNamespaceNames + $wgExtraNamespaces; } +// Merge in the legacy language codes, unless overridden in the config +if ( !isset( $wgDummyLanguageCodes ) ) { + $wgDummyLanguageCodes = [ + 'qqq' => 'qqq', // Used for message documentation + 'qqx' => 'qqx', // Used for viewing message keys + ] + $wgExtraLanguageCodes + LanguageCode::getDeprecatedCodeMapping(); +} + // These are now the same, always // To determine the user language, use $wgLang->getCode() $wgContLanguageCode = $wgLanguageCode; @@ -462,7 +472,7 @@ if ( $wgMaximalPasswordLength !== false ) { } // Backwards compatibility warning -if ( !$wgSessionsInObjectCache && !$wgSessionsInMemcached ) { +if ( !$wgSessionsInObjectCache ) { wfDeprecated( '$wgSessionsInObjectCache = false', '1.27' ); if ( $wgSessionHandler ) { wfDeprecated( '$wgSessionsHandler', '1.27' ); @@ -497,10 +507,6 @@ if ( $wgDebugToolbar && !$wgCommandLineMode ) { 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' ); @@ -523,35 +529,6 @@ if ( $wgSharedDB && $wgSharedTables ) { // is complete. define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 ); -// Install a header callback to prevent caching of responses with cookies (T127993) -if ( !$wgCommandLineMode ) { - header_register_callback( function () { - $headers = []; - foreach ( headers_list() as $header ) { - list( $name, $value ) = explode( ':', $header, 2 ); - $headers[strtolower( trim( $name ) )][] = trim( $value ); - } - - if ( isset( $headers['set-cookie'] ) ) { - $cacheControl = isset( $headers['cache-control'] ) - ? implode( ', ', $headers['cache-control'] ) - : ''; - - if ( !preg_match( '/(?:^|,)\s*(?:private|no-cache|no-store)\s*(?:$|,)/i', $cacheControl ) ) { - header( 'Expires: Thu, 01 Jan 1970 00:00:00 GMT' ); - header( 'Cache-Control: private, max-age=0, s-maxage=0' ); - MediaWiki\Logger\LoggerFactory::getInstance( 'cache-cookies' )->warning( - 'Cookies set on {url} with Cache-Control "{cache-control}"', [ - 'url' => WebRequest::getGlobalRequestURL(), - 'cookies' => $headers['set-cookie'], - 'cache-control' => $cacheControl ?: '', - ] - ); - } - } - } ); -} - MWExceptionHandler::installHandler(); require_once "$IP/includes/compat/normal/UtfNormalUtil.php"; @@ -878,7 +855,6 @@ if ( !$wgCommandLineMode ) { Pingback::schedulePingback(); } -wfDebug( "Fully initialised\n" ); $wgFullyInitialised = true; Profiler::instance()->scopedProfileOut( $ps_extensions );