3 * Main wiki script; see docs/design.txt
6 $wgRequestTime = microtime(true);
8 # getrusage() does not exist on the Microsoft Windows platforms, catching this
9 if ( function_exists ( 'getrusage' ) ) {
10 $wgRUstart = getrusage();
16 @ini_set
( 'allow_url_fopen', 0 ); # For security...
18 if ( isset( $_REQUEST['GLOBALS'] ) ) {
19 die( '<a href="http://www.hardened-php.net/index.76.html">$GLOBALS overwrite vulnerability</a>');
22 # Valid web server entry point, enable includes.
23 # Please don't move this line to includes/Defines.php. This line essentially
24 # defines a valid entry point. If you put it in includes/Defines.php, then
25 # any script that includes it becomes an entry point, thereby defeating
27 define( 'MEDIAWIKI', true );
29 # Load up some global defines.
30 require_once( './includes/Defines.php' );
32 # LocalSettings.php is the per site customization file. If it does not exit
33 # the wiki installer need to be launched or the generated file moved from
35 if( !file_exists( 'LocalSettings.php' ) ) {
37 require_once( 'includes/DefaultSettings.php' ); # used for printing the version
39 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
40 <html xmlns
='http://www.w3.org/1999/xhtml' xml
:lang
='en' lang
='en'>
42 <title
>MediaWiki
<?php
echo $wgVersion ?
></title
>
43 <meta http
-equiv
='Content-Type' content
='text/html; charset=utf-8' />
44 <style type
='text/css' media
='screen, projection'>
47 background
-color
: #fff;
48 font
-family
: sans
-serif
;
58 <img src
='skins/common/images/mediawiki.png' alt
='The MediaWiki logo' />
60 <h1
>MediaWiki
<?php
echo $wgVersion ?
></h1
>
63 if ( file_exists( 'config/LocalSettings.php' ) ) {
64 echo( 'To complete the installation, move <tt>config/LocalSettings.php</tt> to the parent directory.' );
66 echo( 'Please <a href="config/index.php" title="setup">setup the wiki</a> first.' );
77 # Include this site setttings
78 require_once( './LocalSettings.php' );
80 require_once( 'includes/Setup.php' );
82 # Initialize MediaWiki base class
83 require_once( "includes/Wiki.php" );
84 $mediaWiki = new MediaWiki();
86 wfProfileIn( 'main-misc-setup' );
87 OutputPage
::setEncodings(); # Not really used yet
90 $action = $wgRequest->getVal( 'action', 'view' );
91 $title = $wgRequest->getVal( 'title' );
94 # Send Ajax requests to the Ajax dispatcher.
96 if ( $wgUseAjax && $action == 'ajax' ) {
97 require_once( 'AjaxDispatcher.php' );
99 $dispatcher = new AjaxDispatcher();
100 $dispatcher->performAction();
105 $wgTitle = $mediaWiki->checkInitialQueries( $title,$action,$wgOut, $wgRequest, $wgContLang );
106 if ($wgTitle == NULL) {
110 wfProfileOut( 'main-misc-setup' );
112 # Setting global variables in mediaWiki
113 $mediaWiki->setVal( 'Server', $wgServer );
114 $mediaWiki->setVal( 'DisableInternalSearch', $wgDisableInternalSearch );
115 $mediaWiki->setVal( 'action', $action );
116 $mediaWiki->setVal( 'SquidMaxage', $wgSquidMaxage );
117 $mediaWiki->setVal( 'EnableDublinCoreRdf', $wgEnableDublinCoreRdf );
118 $mediaWiki->setVal( 'EnableCreativeCommonsRdf', $wgEnableCreativeCommonsRdf );
119 $mediaWiki->setVal( 'CommandLineMode', $wgCommandLineMode );
120 $mediaWiki->setVal( 'UseExternalEditor', $wgUseExternalEditor );
121 $mediaWiki->setVal( 'DisabledActions', $wgDisabledActions );
123 $wgArticle = $mediaWiki->initialize ( $wgTitle, $wgOut, $wgUser, $wgRequest );
124 $mediaWiki->finalCleanup ( $wgDeferredUpdateList, $wgLoadBalancer, $wgOut );
126 # Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup
127 $mediaWiki->doUpdates( $wgPostCommitUpdateList );
129 $mediaWiki->restInPeace( $wgLoadBalancer );