Reverting r16861; incompatible change to message texts, breaks a lot of toggle displa...
[lhc/web/wiklou.git] / includes / WebStart.php
1 <?php
2
3 # This does the initial setup for a web request. It does some security checks,
4 # starts the profiler and loads the configuration, and optionally loads
5 # Setup.php depending on whether MW_NO_SETUP is defined.
6
7 $wgRequestTime = microtime(true);
8 # getrusage() does not exist on the Microsoft Windows platforms, catching this
9 if ( function_exists ( 'getrusage' ) ) {
10 $wgRUstart = getrusage();
11 } else {
12 $wgRUstart = array();
13 }
14 unset( $IP );
15 @ini_set( 'allow_url_fopen', 0 ); # For security
16
17 if ( isset( $_REQUEST['GLOBALS'] ) ) {
18 die( '<a href="http://www.hardened-php.net/index.76.html">$GLOBALS overwrite vulnerability</a>');
19 }
20
21 # Valid web server entry point, enable includes.
22 # Please don't move this line to includes/Defines.php. This line essentially
23 # defines a valid entry point. If you put it in includes/Defines.php, then
24 # any script that includes it becomes an entry point, thereby defeating
25 # its purpose.
26 define( 'MEDIAWIKI', true );
27
28 # Start profiler
29 require_once( './StartProfiler.php' );
30 wfProfileIn( 'WebStart.php-conf' );
31
32 # Load up some global defines.
33 require_once( './includes/Defines.php' );
34
35 # LocalSettings.php is the per site customization file. If it does not exit
36 # the wiki installer need to be launched or the generated file moved from
37 # ./config/ to ./
38 if( !file_exists( './LocalSettings.php' ) ) {
39 $IP = '.';
40 require_once( './includes/DefaultSettings.php' ); # used for printing the version
41 require_once( './includes/templates/NoLocalSettings.php' );
42 die();
43 }
44
45 # Include this site setttings
46 require_once( './LocalSettings.php' );
47 wfProfileOut( 'WebStart.php-conf' );
48
49 if ( !defined( 'MW_NO_SETUP' ) ) {
50 require_once( './includes/Setup.php' );
51 }
52 ?>