die( 'MediaWiki does not support installations where mbstring.func_overload is non-zero.' );
}
+// Define MW_ENTRY_POINT if it's not already, so that config code can check the
+// value without using defined()
+if ( !defined( 'MW_ENTRY_POINT' ) ) {
+ /**
+ * The entry point, which may be either the script filename without the
+ * file extension, or "cli" for maintenance scripts, or "unknown" for any
+ * entry point that does not set the constant.
+ */
+ define( 'MW_ENTRY_POINT', 'unknown' );
+}
+
// Start the autoloader, so that extensions can derive classes from core files
require_once "$IP/includes/AutoLoader.php";
$wgUsersNotifiedOnAllChanges = [];
}
-if ( $wgMetaNamespace === false ) {
- $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
+// $wgSysopEmailBans deprecated in 1.34
+if ( isset( $wgSysopEmailBans ) && $wgSysopEmailBans === false ) {
+ foreach ( $wgGroupPermissions as $group => $_ ) {
+ unset( $wgGroupPermissions[$group]['blockemail'] );
+ }
}
-// Default value is 2000 or the suhosin limit if it is between 1 and 2000
-if ( $wgResourceLoaderMaxQueryLength === false ) {
- $suhosinMaxValueLength = (int)ini_get( 'suhosin.get.max_value_length' );
- if ( $suhosinMaxValueLength > 0 && $suhosinMaxValueLength < 2000 ) {
- $wgResourceLoaderMaxQueryLength = $suhosinMaxValueLength;
- } else {
- $wgResourceLoaderMaxQueryLength = 2000;
- }
- unset( $suhosinMaxValueLength );
+if ( $wgMetaNamespace === false ) {
+ $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
}
// Ensure the minimum chunk size is less than PHP upload limits or the maximum
$wgSquidMaxage = $wgCdnMaxAge;
}
-// Easy to forget to falsify $wgDebugToolbar for static caches.
-// If file cache or CDN cache is on, just disable this (DWIMD).
-if ( $wgUseFileCache || $wgUseCdn ) {
- $wgDebugToolbar = false;
-}
-
// Blacklisted file extensions shouldn't appear on the "allowed" list
$wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) );
$wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable';
}
-// Disable MWDebug for command line mode, this prevents MWDebug from eating up
-// all the memory from logging SQL queries on maintenance scripts
-global $wgCommandLineMode;
-if ( $wgDebugToolbar && !$wgCommandLineMode ) {
- MWDebug::init();
-}
+MWDebug::setup();
// 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.
// Initialize the session
try {
$session = MediaWiki\Session\SessionManager::getGlobalSession();
- } catch ( OverflowException $ex ) {
- if ( isset( $ex->sessionInfos ) && count( $ex->sessionInfos ) >= 2 ) {
- // The exception is because the request had multiple possible
- // sessions tied for top priority. Report this to the user.
- $list = [];
- foreach ( $ex->sessionInfos as $info ) {
- $list[] = $info->getProvider()->describe( $wgContLang );
- }
- $list = $wgContLang->listToText( $list );
- throw new HttpError( 400,
- Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $wgContLang )->plain()
- );
+ } catch ( MediaWiki\Session\SessionOverflowException $ex ) {
+ // The exception is because the request had multiple possible
+ // sessions tied for top priority. Report this to the user.
+ $list = [];
+ foreach ( $ex->getSessionInfos() as $info ) {
+ $list[] = $info->getProvider()->describe( $wgContLang );
}
-
- // Not the one we want, rethrow
- throw $ex;
+ $list = $wgContLang->listToText( $list );
+ throw new HttpError( 400,
+ Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $wgContLang )->plain()
+ );
}
if ( $session->isPersistent() ) {