X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FSetup.php;h=df53c9976a9ecb82e8121590d3aaf9c9d570590b;hp=f367fc2278cf61c77a3310613110ea98a0dccff4;hb=c05b8b7c473a7dd9c832f91366c45cb8a35c2df2;hpb=10ec68ee372db0ead8aa9626ed9bb3bd328b98f1 diff --git a/includes/Setup.php b/includes/Setup.php index f367fc2278..df53c9976a 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 ); @@ -143,6 +149,9 @@ if ( $wgScript === false ) { if ( $wgLoadScript === false ) { $wgLoadScript = "$wgScriptPath/load.php"; } +if ( $wgRestPath === false ) { + $wgRestPath = "$wgScriptPath/rest.php"; +} if ( $wgArticlePath === false ) { if ( $wgUsePathInfo ) { @@ -751,7 +760,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+ @@ -804,7 +815,9 @@ if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) { // Useful debug output if ( $wgCommandLineMode ) { - wfDebug( "\n\nStart command line script $self\n" ); + if ( isset( $self ) ) { + wfDebug( "\n\nStart command line script $self\n" ); + } } else { $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";