-if ( !class_exists( 'AutoLoader' ) ) {
- require_once( "$IP/includes/AutoLoader.php" );
-}
-
-wfProfileIn( $fname.'-exception' );
-require_once( "$IP/includes/Exception.php" );
-wfInstallExceptionHandler();
-wfProfileOut( $fname.'-exception' );
-
-wfProfileIn( $fname.'-includes' );
-require_once( "$IP/includes/GlobalFunctions.php" );
-require_once( "$IP/includes/Hooks.php" );
-require_once( "$IP/includes/Namespace.php" );
-require_once( "$IP/includes/ProxyTools.php" );
-require_once( "$IP/includes/ObjectCache.php" );
-require_once( "$IP/includes/ImageFunctions.php" );
-wfProfileOut( $fname.'-includes' );
-wfProfileIn( $fname.'-misc1' );
-
-# Raise the memory limit if it's too low
-wfMemoryLimit();
-
-/**
- * Set up the timezone, suppressing the pseudo-security warning in PHP 5.1+
- * that happens whenever you use a date function without the timezone being
- * explicitly set. Inspired by phpMyAdmin's treatment of the problem.
- */
-wfSuppressWarnings();
-date_default_timezone_set( date_default_timezone_get() );
-wfRestoreWarnings();
-
-# Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
-$wgRequest = new WebRequest;
-
-# Useful debug output
-global $wgCommandLineMode;
-if ( $wgCommandLineMode ) {
- wfDebug( "\n\nStart command line script $self\n" );
-} else {
- wfDebug( "Start request\n\n" );
- # Output the REQUEST_URI. This is not supported by IIS in rewrite mode,
- # so use an alternative
- $requestUri = isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] :
- ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ? $_SERVER['HTTP_X_ORIGINAL_URL'] :
- $_SERVER['PHP_SELF'] );
- wfDebug( "{$_SERVER['REQUEST_METHOD']} {$requestUri}\n" );
-
- if ( $wgDebugPrintHttpHeaders ) {
- $headerOut = "HTTP HEADERS:\n";
-
- if ( function_exists( 'getallheaders' ) ) {
- $headers = getallheaders();
- foreach ( $headers as $name => $value ) {
- $headerOut .= "$name: $value\n";
- }
- } else {
- $headers = $_SERVER;
- foreach ( $headers as $name => $value ) {
- if ( substr( $name, 0, 5 ) !== 'HTTP_' ) continue;
- $name = substr( $name, 5 );
- $headerOut .= "$name: $value\n";
- }
- }
- wfDebug( "$headerOut\n" );
- }
-}
-
-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);
- for( $i = 0; $i < count($wgRCLinkDays); $i++ ) {
- if( $wgRCLinkDays[$i] >= $wgRCMaxAge / ( 3600 * 24 ) ) {
- $wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i+1, false );