Debugging code left in, probably needs an option of some kind.
[mediawiki.git] / index.php
blob4cadf7887f8f22df362fc25f438839d37d16484e
1 <?php
3 /**
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/
14 * ----------
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, Yuri Astrakhan, Aryeh Gregor,
19 * Aaron Schulz and others.
21 * This program is free software; you can redistribute it and/or modify
22 * it under the terms of the GNU General Public License as published by
23 * the Free Software Foundation; either version 2 of the License, or
24 * (at your option) any later version.
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
31 * You should have received a copy of the GNU General Public License along
32 * with this program; if not, write to the Free Software Foundation, Inc.,
33 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
34 * http://www.gnu.org/copyleft/gpl.html
38 # Initialise common code
39 $preIP = dirname( __FILE__ );
40 require_once( "$preIP/includes/WebStart.php" );
42 # Initialize MediaWiki base class
43 require_once( "$preIP/includes/Wiki.php" );
44 $mediaWiki = new MediaWiki();
46 wfProfileIn( 'main-misc-setup' );
47 OutputPage::setEncodings(); # Not really used yet
49 $maxLag = $wgRequest->getVal( 'maxlag' );
50 if ( !is_null( $maxLag ) ) {
51 if ( !$mediaWiki->checkMaxLag( $maxLag ) ) {
52 exit;
56 # Query string fields
57 $action = $wgRequest->getVal( 'action', 'view' );
58 $title = $wgRequest->getVal( 'title' );
60 $wgTitle = $mediaWiki->checkInitialQueries( $title, $action );
61 if ($wgTitle == NULL) {
62 unset( $wgTitle );
65 wfProfileOut( 'main-misc-setup' );
68 # Send Ajax requests to the Ajax dispatcher.
70 if ( $wgUseAjax && $action == 'ajax' ) {
71 require_once( $IP . '/includes/AjaxDispatcher.php' );
73 $dispatcher = new AjaxDispatcher();
74 $dispatcher->performAction();
75 $mediaWiki->restInPeace();
76 exit;
79 # Setting global variables in mediaWiki
80 $mediaWiki->setVal( 'action', $action );
81 $mediaWiki->setVal( 'CommandLineMode', $wgCommandLineMode );
82 $mediaWiki->setVal( 'DisabledActions', $wgDisabledActions );
83 $mediaWiki->setVal( 'DisableHardRedirects', $wgDisableHardRedirects );
84 $mediaWiki->setVal( 'DisableInternalSearch', $wgDisableInternalSearch );
85 $mediaWiki->setVal( 'EnableCreativeCommonsRdf', $wgEnableCreativeCommonsRdf );
86 $mediaWiki->setVal( 'EnableDublinCoreRdf', $wgEnableDublinCoreRdf );
87 $mediaWiki->setVal( 'JobRunRate', $wgJobRunRate );
88 $mediaWiki->setVal( 'Server', $wgServer );
89 $mediaWiki->setVal( 'SquidMaxage', $wgSquidMaxage );
90 $mediaWiki->setVal( 'UseExternalEditor', $wgUseExternalEditor );
91 $mediaWiki->setVal( 'UsePathInfo', $wgUsePathInfo );
93 $mediaWiki->initialize( $wgTitle, $wgArticle, $wgOut, $wgUser, $wgRequest );
94 $mediaWiki->finalCleanup ( $wgDeferredUpdateList, $wgOut );
96 # Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup
97 $mediaWiki->doUpdates( $wgPostCommitUpdateList );
99 $mediaWiki->restInPeace();