4 * This is the main web entry point for MediaWiki.
6 * If you are reading this in your web browser, your server is probably
7 * not configured correctly to run PHP applications!
9 * See the README, INSTALL, and UPGRADE files for basic setup instructions
10 * and pointers to the online documentation.
12 * http://www.mediawiki.org/
16 * Copyright (C) 2001-2008 Magnus Manske, Brion Vibber, Lee Daniel Crocker,
17 * Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason,
18 * Niklas Laxström, Domas Mituzas, Rob Church and others.
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 2 of the License, or
23 * (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License along
31 * with this program; if not, write to the Free Software Foundation, Inc.,
32 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
33 * http://www.gnu.org/copyleft/gpl.html
37 # Initialise common code
38 $preIP = dirname( __FILE__
);
39 require_once( "$preIP/includes/WebStart.php" );
41 # Initialize MediaWiki base class
42 require_once( "$preIP/includes/Wiki.php" );
43 $mediaWiki = new MediaWiki();
45 wfProfileIn( 'main-misc-setup' );
46 OutputPage
::setEncodings(); # Not really used yet
48 $maxLag = $wgRequest->getVal( 'maxlag' );
49 if ( !is_null( $maxLag ) ) {
50 if ( !$mediaWiki->checkMaxLag( $maxLag ) ) {
56 $action = $wgRequest->getVal( 'action', 'view' );
57 $title = $wgRequest->getVal( 'title' );
59 $wgTitle = $mediaWiki->checkInitialQueries( $title, $action, $wgOut, $wgRequest, $wgContLang );
60 if ($wgTitle == NULL) {
65 # Send Ajax requests to the Ajax dispatcher.
67 if ( $wgUseAjax && $action == 'ajax' ) {
68 require_once( $IP . '/includes/AjaxDispatcher.php' );
70 $dispatcher = new AjaxDispatcher();
71 $dispatcher->performAction();
72 $mediaWiki->restInPeace( $wgLoadBalancer );
77 wfProfileOut( 'main-misc-setup' );
79 # Setting global variables in mediaWiki
80 $mediaWiki->setVal( 'Server', $wgServer );
81 $mediaWiki->setVal( 'DisableInternalSearch', $wgDisableInternalSearch );
82 $mediaWiki->setVal( 'action', $action );
83 $mediaWiki->setVal( 'SquidMaxage', $wgSquidMaxage );
84 $mediaWiki->setVal( 'EnableDublinCoreRdf', $wgEnableDublinCoreRdf );
85 $mediaWiki->setVal( 'EnableCreativeCommonsRdf', $wgEnableCreativeCommonsRdf );
86 $mediaWiki->setVal( 'CommandLineMode', $wgCommandLineMode );
87 $mediaWiki->setVal( 'UseExternalEditor', $wgUseExternalEditor );
88 $mediaWiki->setVal( 'DisabledActions', $wgDisabledActions );
90 $wgArticle = $mediaWiki->initialize ( $wgTitle, $wgOut, $wgUser, $wgRequest );
91 $mediaWiki->finalCleanup ( $wgDeferredUpdateList, $wgLoadBalancer, $wgOut );
93 # Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup
94 $mediaWiki->doUpdates( $wgPostCommitUpdateList );
96 $mediaWiki->restInPeace( $wgLoadBalancer );