Clean up the mess that is wfDie (resolves r85918). wfDie() doesn't exist anymore...
[lhc/web/wiklou.git] / index.php
1 <?php
2 /**
3 * This is the main web entry point for MediaWiki.
4 *
5 * If you are reading this in your web browser, your server is probably
6 * not configured correctly to run PHP applications!
7 *
8 * See the README, INSTALL, and UPGRADE files for basic setup instructions
9 * and pointers to the online documentation.
10 *
11 * http://www.mediawiki.org/
12 *
13 * ----------
14 *
15 * Copyright (C) 2001-2011 Magnus Manske, Brion Vibber, Lee Daniel Crocker,
16 * Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason,
17 * Niklas Laxström, Domas Mituzas, Rob Church, Yuri Astrakhan, Aryeh Gregor,
18 * Aaron Schulz, Andrew Garrett, Raimond Spekking, Alexandre Emsenhuber
19 * Siebrand Mazeland, Chad Horohoe, Roan Kattouw and others.
20 *
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.
25 *
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.
30 *
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
35 *
36 * @file
37 */
38
39 // Bail on old versions of PHP. Pretty much every other file in the codebase
40 // has structures (try/catch, foo()->bar(), etc etc) which throw parse errors in PHP 4.
41 // Setup.php and ObjectCache.php have structures invalid in PHP 5.0 and 5.1, respectively.
42 if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.2.3' ) < 0 ) {
43 require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' );
44 wfPHPVersionError( 'index.php' );
45 }
46
47 # Initialise common code. This gives us access to GlobalFunctions, the AutoLoader, and
48 # the globals $wgRequest, $wgOut, $wgUser, $wgLang and $wgContLang, amongst others; it
49 # does *not* load $wgTitle
50 if ( isset( $_SERVER['MW_COMPILED'] ) ) {
51 require ( 'phase3/includes/WebStart.php' );
52 } else {
53 require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
54 }
55
56 $mediaWiki = new MediaWiki();
57 $mediaWiki->run();