X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSetup.php;h=201e1a9d427f6ba7350b9b5ceabb773779140fed;hb=22a0bde74b67e064660bfd95b0c03d14ddff0a34;hp=641f1f903035d8bb6e085155c0aaa0df06c88ec9;hpb=5b202d729d540bdabbf74c3faf8e3ce5e946cbb1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index 641f1f9030..201e1a9d42 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -55,7 +55,7 @@ if ( ini_get( 'mbstring.func_overload' ) ) { // Start the autoloader, so that extensions can derive classes from core files require_once "$IP/includes/AutoLoader.php"; -// Load up some global defines +// Load global constants require_once "$IP/includes/Defines.php"; // Load default settings @@ -89,9 +89,17 @@ if ( !interface_exists( 'Psr\Log\LoggerInterface' ) ) { die( 1 ); } +/** + * Changes to the PHP environment that don't vary on configuration. + */ + // Install a header callback MediaWiki\HeaderCallback::register(); +// Set the encoding used by reading HTTP input, writing HTTP output. +// This is also the default for mbstring functions. +mb_internal_encoding( 'UTF-8' ); + /** * Load LocalSettings.php */ @@ -128,8 +136,6 @@ ExtensionRegistry::getInstance()->loadFromQueue(); // Don't let any other extensions load ExtensionRegistry::getInstance()->finish(); -mb_internal_encoding( 'UTF-8' ); - // Set the configured locale on all requests for consisteny putenv( "LC_ALL=$wgShellLocale" ); setlocale( LC_ALL, $wgShellLocale ); @@ -387,6 +393,8 @@ $wgDefaultUserOptions['watchlistdays'] = min( unset( $rcMaxAgeDays ); if ( $wgSkipSkin ) { + // Hard deprecated in 1.34. + wfDeprecated( '$wgSkipSkin – use $wgSkipSkins instead', '1.23' ); $wgSkipSkins[] = $wgSkipSkin; } @@ -394,6 +402,8 @@ $wgSkipSkins[] = 'fallback'; $wgSkipSkins[] = 'apioutput'; if ( $wgLocalInterwiki ) { + // Hard deprecated in 1.34. + wfDeprecated( '$wgLocalInterwiki – use $wgLocalInterwikis instead', '1.23' ); array_unshift( $wgLocalInterwikis, $wgLocalInterwiki ); } @@ -473,25 +483,7 @@ $wgMinUploadChunkSize = min( * Definitions of the NS_ constants are in Defines.php * @private */ -$wgCanonicalNamespaceNames = [ - NS_MEDIA => 'Media', - NS_SPECIAL => 'Special', - NS_TALK => 'Talk', - NS_USER => 'User', - NS_USER_TALK => 'User_talk', - NS_PROJECT => 'Project', - NS_PROJECT_TALK => 'Project_talk', - NS_FILE => 'File', - NS_FILE_TALK => 'File_talk', - NS_MEDIAWIKI => 'MediaWiki', - NS_MEDIAWIKI_TALK => 'MediaWiki_talk', - NS_TEMPLATE => 'Template', - NS_TEMPLATE_TALK => 'Template_talk', - NS_HELP => 'Help', - NS_HELP_TALK => 'Help_talk', - NS_CATEGORY => 'Category', - NS_CATEGORY_TALK => 'Category_talk', -]; +$wgCanonicalNamespaceNames = NamespaceInfo::$canonicalNames; /// @todo UGLY UGLY if ( is_array( $wgExtraNamespaces ) ) { @@ -579,12 +571,6 @@ if ( $wgUseFileCache || $wgUseCdn ) { $wgDebugToolbar = false; } -// We always output HTML5 since 1.22, overriding these is no longer supported -// we set them here for extensions that depend on its value. -$wgHtml5 = true; -$wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml'; -$wgJsMimeType = 'text/javascript'; - // Blacklisted file extensions shouldn't appear on the "allowed" list $wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) ); @@ -622,6 +608,11 @@ if ( $wgCookieSecure === 'detect' ) { } if ( $wgProfileOnly ) { + // Hard deprecated in 1.34. + wfDeprecated( + '$wgProfileOnly set the log file in $wgDebugLogGroups[\'profileoutput\'] instead', + '1.23' + ); $wgDebugLogGroups['profileoutput'] = $wgDebugLogFile; $wgDebugLogFile = ''; } @@ -754,7 +745,9 @@ Profiler::instance()->scopedProfileOut( $ps_default2 ); $ps_misc = Profiler::instance()->scopedProfileIn( $fname . '-misc' ); // Raise the memory limit if it's too low -wfMemoryLimit(); +// Note, this makes use of wfDebug, and thus should not be before +// MWDebug::init() is called. +wfMemoryLimit( $wgMemoryLimit ); /** * Set up the timezone, suppressing the pseudo-security warning in PHP 5.1+ @@ -812,13 +805,9 @@ if ( $wgCommandLineMode ) { } } else { $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n"; - - if ( $wgDebugPrintHttpHeaders ) { - $debug .= "HTTP HEADERS:\n"; - - foreach ( $wgRequest->getAllHeaders() as $name => $value ) { - $debug .= "$name: $value\n"; - } + $debug .= "HTTP HEADERS:\n"; + foreach ( $wgRequest->getAllHeaders() as $name => $value ) { + $debug .= "$name: $value\n"; } wfDebug( $debug ); }