tweaks:
[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 );
60 if ($wgTitle == NULL) {
61 unset( $wgTitle );
62 }
63
64 wfProfileOut( 'main-misc-setup' );
65
66 #
67 # Send Ajax requests to the Ajax dispatcher.
68 #
69 if ( $wgUseAjax && $action == 'ajax' ) {
70 require_once( $IP . '/includes/AjaxDispatcher.php' );
71
72 $dispatcher = new AjaxDispatcher();
73 $dispatcher->performAction();
74 $mediaWiki->restInPeace();
75 exit;
76 }
77
78 # Setting global variables in mediaWiki
79 $mediaWiki->setVal( 'action', $action );
80 $mediaWiki->setVal( 'CommandLineMode', $wgCommandLineMode );
81 $mediaWiki->setVal( 'DisabledActions', $wgDisabledActions );
82 $mediaWiki->setVal( 'DisableHardRedirects', $wgDisableHardRedirects );
83 $mediaWiki->setVal( 'DisableInternalSearch', $wgDisableInternalSearch );
84 $mediaWiki->setVal( 'EnableCreativeCommonsRdf', $wgEnableCreativeCommonsRdf );
85 $mediaWiki->setVal( 'EnableDublinCoreRdf', $wgEnableDublinCoreRdf );
86 $mediaWiki->setVal( 'JobRunRate', $wgJobRunRate );
87 $mediaWiki->setVal( 'Server', $wgServer );
88 $mediaWiki->setVal( 'SquidMaxage', $wgSquidMaxage );
89 $mediaWiki->setVal( 'UseExternalEditor', $wgUseExternalEditor );
90 $mediaWiki->setVal( 'UsePathInfo', $wgUsePathInfo );
91
92 $mediaWiki->initialize( $wgTitle, $wgArticle, $wgOut, $wgUser, $wgRequest );
93 $mediaWiki->finalCleanup ( $wgDeferredUpdateList, $wgOut );
94
95 # Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup
96 $mediaWiki->doUpdates( $wgPostCommitUpdateList );
97
98 $mediaWiki->restInPeace();
99