// Install a header callback
MediaWiki\HeaderCallback::register();
-// Set the encoding used by reading HTTP input, writing HTTP output.
+// Set the encoding used by PHP for reading HTTP input, and writing output.
// This is also the default for mbstring functions.
mb_internal_encoding( 'UTF-8' );
* Main setup
*/
-$fname = 'Setup.php';
-$ps_setup = Profiler::instance()->scopedProfileIn( $fname );
-
// Load queued extensions
ExtensionRegistry::getInstance()->loadFromQueue();
// Don't let any other extensions load
setlocale( LC_ALL, $wgShellLocale );
// Set various default paths sensibly...
-$ps_default = Profiler::instance()->scopedProfileIn( $fname . '-defaults' );
-
if ( $wgScript === false ) {
$wgScript = "$wgScriptPath/index.php";
}
unset( $repo ); // no global pollution; destroy reference
$rcMaxAgeDays = $wgRCMaxAge / ( 3600 * 24 );
-if ( $wgRCFilterByAge ) {
- // Trim down $wgRCLinkDays so that it only lists links which are valid
- // as determined by $wgRCMaxAge.
- // Note that we allow 1 link higher than the max for things like 56 days but a 60 day link.
- sort( $wgRCLinkDays );
-
- foreach ( $wgRCLinkDays as $i => $days ) {
- if ( $days >= $rcMaxAgeDays ) {
- array_splice( $wgRCLinkDays, $i + 1 );
- break;
- }
- }
-}
// Ensure that default user options are not invalid, since that breaks Special:Preferences
$wgDefaultUserOptions['rcdays'] = min(
$wgDefaultUserOptions['rcdays'],
* 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 ) ) {
$wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable';
}
-Profiler::instance()->scopedProfileOut( $ps_default );
-
// Disable MWDebug for command line mode, this prevents MWDebug from eating up
// all the memory from logging SQL queries on maintenance scripts
global $wgCommandLineMode;
}
}
-$ps_default2 = Profiler::instance()->scopedProfileIn( $fname . '-defaults2' );
-
if ( $wgCanonicalServer === false ) {
$wgCanonicalServer = wfExpandUrl( $wgServer, PROTO_HTTP );
}
);
}
-Profiler::instance()->scopedProfileOut( $ps_default2 );
-
-$ps_misc = Profiler::instance()->scopedProfileIn( $fname . '-misc' );
-
// Raise the memory limit if it's too low
// Note, this makes use of wfDebug, and thus should not be before
// MWDebug::init() is called.
', session: ' . get_class( ObjectCache::getInstance( $wgSessionCacheType ) )
);
-Profiler::instance()->scopedProfileOut( $ps_misc );
-
// Most of the config is out, some might want to run hooks here.
Hooks::run( 'SetupAfterCache' );
-$ps_globals = Profiler::instance()->scopedProfileIn( $fname . '-globals' );
-
/**
* @var Language $wgContLang
* @deprecated since 1.32, use the ContentLanguage service directly
*/
$wgTitle = null;
-Profiler::instance()->scopedProfileOut( $ps_globals );
-$ps_extensions = Profiler::instance()->scopedProfileIn( $fname . '-extensions' );
-
// Extension setup functions
// Entries should be added to this variable during the inclusion
// of the extension file. This allows the extension to perform
}
$wgFullyInitialised = true;
-
-Profiler::instance()->scopedProfileOut( $ps_extensions );
-Profiler::instance()->scopedProfileOut( $ps_setup );