X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=index.php;h=0e9676da299d5ced433e66db82b0c455dc73bde2;hb=fc2218288c5bea0c1f7860d366bd8c917c539594;hp=97b2bf80bfd6eb037d575e096e4bc9610c3008a8;hpb=3ccace42c0b0900ae720ad5a73d0512e2131c3ff;p=lhc%2Fweb%2Fwiklou.git diff --git a/index.php b/index.php index 97b2bf80bf..0e9676da29 100644 --- a/index.php +++ b/index.php @@ -1,70 +1,59 @@ bar(), etc etc) which throw parse errors in +# PHP 4. Setup.php and ObjectCache.php have structures invalid in PHP 5.0 and +# 5.1, respectively. +if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) { + // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+ + require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' ); + wfPHPVersionError( 'index.php' ); } -unset( $IP ); -@ini_set( 'allow_url_fopen', 0 ); # For security... - -if ( isset( $_REQUEST['GLOBALS'] ) ) { - die( '$GLOBALS overwrite vulnerability'); +# Initialise common code. This gives us access to GlobalFunctions, the +# AutoLoader, and the globals $wgRequest, $wgOut, $wgUser, $wgLang and +# $wgContLang, amongst others; it does *not* load $wgTitle +if ( isset( $_SERVER['MW_COMPILED'] ) ) { + require ( 'phase3/includes/WebStart.php' ); +} else { + require ( __DIR__ . '/includes/WebStart.php' ); } -# Valid web server entry point, enable includes. -# Please don't move this line to includes/Defines.php. This line essentially defines -# a valid entry point. If you put it in includes/Defines.php, then any script that includes -# it becomes an entry point, thereby defeating its purpose. -define( 'MEDIAWIKI', true ); -require_once( './includes/Defines.php' ); -@include_once( './LocalSettings.php' ); # Will die later if not included anyway - - -# Initialize MediaWiki base class -require_once( "includes/Wiki.php" ); $mediaWiki = new MediaWiki(); - - -$mediaWiki->checkSetup(); -require_once( 'includes/Setup.php' ); # This can't be done in mdiaWiki.php for some weird reason - -OutputPage::setEncodings(); # Not really used yet - -# Query string fields -$action = $wgRequest->getVal( 'action', 'view' ); -$title = $wgRequest->getVal( 'title' ); - -$wgTitle = $mediaWiki->checkInitialQueries( $title,$action,$wgOut, $wgRequest, $wgContLang ); - -# Is this necessary? Who knows... -if ($wgTitle == NULL) { - unset( $wgTitle ); -} - -# Setting global variables in mediaWiki -$mediaWiki->setVal( "Server", $wgServer ); -$mediaWiki->setVal( "DisableInternalSearch", $wgDisableInternalSearch ); -$mediaWiki->setVal( "action", $action ); -$mediaWiki->setVal( "SquidMaxage", $wgSquidMaxage ); -$mediaWiki->setVal( "EnableDublinCoreRdf", $wgEnableDublinCoreRdf ); -$mediaWiki->setVal( "EnableCreativeCommonsRdf", $wgEnableCreativeCommonsRdf ); -$mediaWiki->setVal( "CommandLineMode", $wgCommandLineMode ); -$mediaWiki->setVal( "UseExternalEditor", $wgUseExternalEditor ); -$mediaWiki->setVal( "DisabledActions", $wgDisabledActions ); - -$wgArticle = $mediaWiki->initialize ( $wgTitle, $wgOut, $wgUser, $wgRequest ); -$mediaWiki->finalCleanup ( $wgDeferredUpdateList, $wgLoadBalancer, $wgOut ); - -# Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup -$mediaWiki->doUpdates( $wgPostCommitUpdateList ); - -$mediaWiki->restInPeace( $wgLoadBalancer ); -?> +$mediaWiki->run();