* Use full path (for example for apc.filters)
[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-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.
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 $preIP = dirname( __FILE__ );
39 require_once( "$preIP/includes/WebStart.php" );
40
41 # Initialize MediaWiki base class
42 require_once( "$preIP/includes/Wiki.php" );
43 $mediaWiki = new MediaWiki();
44
45 wfProfileIn( 'main-misc-setup' );
46 OutputPage::setEncodings(); # Not really used yet
47
48 $maxLag = $wgRequest->getVal( 'maxlag' );
49 if ( !is_null( $maxLag ) ) {
50 if ( !$mediaWiki->checkMaxLag( $maxLag ) ) {
51 exit;
52 }
53 }
54
55 # Query string fields
56 $action = $wgRequest->getVal( 'action', 'view' );
57 $title = $wgRequest->getVal( 'title' );
58
59 $wgTitle = $mediaWiki->checkInitialQueries( $title,$action,$wgOut, $wgRequest, $wgContLang );
60 if ($wgTitle == NULL) {
61 unset( $wgTitle );
62 }
63
64 #
65 # Send Ajax requests to the Ajax dispatcher.
66 #
67 if ( $wgUseAjax && $action == 'ajax' ) {
68 require_once( $IP . '/includes/AjaxDispatcher.php' );
69
70 $dispatcher = new AjaxDispatcher();
71 $dispatcher->performAction();
72 $mediaWiki->restInPeace( $wgLoadBalancer );
73 exit;
74 }
75
76
77 wfProfileOut( 'main-misc-setup' );
78
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 );
89
90 $wgArticle = $mediaWiki->initialize ( $wgTitle, $wgOut, $wgUser, $wgRequest );
91 $mediaWiki->finalCleanup ( $wgDeferredUpdateList, $wgLoadBalancer, $wgOut );
92
93 # Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup
94 $mediaWiki->doUpdates( $wgPostCommitUpdateList );
95
96 $mediaWiki->restInPeace( $wgLoadBalancer );
97