* (bug 9256) Add a quick note to index.php header comments
[lhc/web/wiklou.git] / index.php
1 <?php
2
3 /**
4 * This is the main web entry point for MediaWiki.
5 *
6 * If you are reading this in your web browser, your server is probably
7 * not configured correctly to run PHP applications!
8 *
9 * See the README, INSTALL, and UPGRADE files for basic setup instructions
10 * and pointers to the online documentation.
11 *
12 * http://www.mediawiki.org/
13 *
14 * ----------
15 *
16 * Copyright (C) 2001-2007 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.
19 *
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.
24 *
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.
29 *
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
34 */
35
36
37 # Initialise common code
38 require_once( './includes/WebStart.php' );
39
40 # Initialize MediaWiki base class
41 require_once( "includes/Wiki.php" );
42 $mediaWiki = new MediaWiki();
43
44 wfProfileIn( 'main-misc-setup' );
45 OutputPage::setEncodings(); # Not really used yet
46
47 # Query string fields
48 $action = $wgRequest->getVal( 'action', 'view' );
49 $title = $wgRequest->getVal( 'title' );
50
51 $wgTitle = $mediaWiki->checkInitialQueries( $title,$action,$wgOut, $wgRequest, $wgContLang );
52 if ($wgTitle == NULL) {
53 unset( $wgTitle );
54 }
55
56 #
57 # Send Ajax requests to the Ajax dispatcher.
58 #
59 if ( $wgUseAjax && $action == 'ajax' ) {
60 require_once( $IP . '/includes/AjaxDispatcher.php' );
61
62 $dispatcher = new AjaxDispatcher();
63 $dispatcher->performAction();
64 $mediaWiki->restInPeace( $wgLoadBalancer );
65 exit;
66 }
67
68
69 wfProfileOut( 'main-misc-setup' );
70
71 # Setting global variables in mediaWiki
72 $mediaWiki->setVal( 'Server', $wgServer );
73 $mediaWiki->setVal( 'DisableInternalSearch', $wgDisableInternalSearch );
74 $mediaWiki->setVal( 'action', $action );
75 $mediaWiki->setVal( 'SquidMaxage', $wgSquidMaxage );
76 $mediaWiki->setVal( 'EnableDublinCoreRdf', $wgEnableDublinCoreRdf );
77 $mediaWiki->setVal( 'EnableCreativeCommonsRdf', $wgEnableCreativeCommonsRdf );
78 $mediaWiki->setVal( 'CommandLineMode', $wgCommandLineMode );
79 $mediaWiki->setVal( 'UseExternalEditor', $wgUseExternalEditor );
80 $mediaWiki->setVal( 'DisabledActions', $wgDisabledActions );
81
82 $wgArticle = $mediaWiki->initialize ( $wgTitle, $wgOut, $wgUser, $wgRequest );
83 $mediaWiki->finalCleanup ( $wgDeferredUpdateList, $wgLoadBalancer, $wgOut );
84
85 # Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup
86 $mediaWiki->doUpdates( $wgPostCommitUpdateList );
87
88 $mediaWiki->restInPeace( $wgLoadBalancer );
89 ?>