finishing moving of code from inex.php to includes/Wiki.php
[lhc/web/wiklou.git] / index.php
1 <?php
2 /**
3 * Main wiki script; see docs/design.txt
4 * @package MediaWiki
5 */
6 $wgRequestTime = microtime();
7
8 unset( $IP );
9 @ini_set( 'allow_url_fopen', 0 ); # For security...
10
11 if ( isset( $_REQUEST['GLOBALS'] ) ) {
12 die( '<a href="http://www.hardened-php.net/index.76.html">$GLOBALS overwrite vulnerability</a>');
13 }
14
15 # Valid web server entry point, enable includes.
16 # Please don't move this line to includes/Defines.php. This line essentially defines
17 # a valid entry point. If you put it in includes/Defines.php, then any script that includes
18 # it becomes an entry point, thereby defeating its purpose.
19 define( 'MEDIAWIKI', true );
20 require_once( './includes/Defines.php' );
21
22 if( !file_exists( 'LocalSettings.php' ) ) {
23 $IP = "." ;
24 require_once( 'includes/DefaultSettings.php' ); # used for printing the version
25 ?>
26 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
27 <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
28 <head>
29 <title>MediaWiki <?php echo $wgVersion ?></title>
30 <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
31 <style type='text/css' media='screen, projection'>
32 html, body {
33 color: #000;
34 background-color: #fff;
35 font-family: sans-serif;
36 text-align: center;
37 }
38
39 h1 {
40 font-size: 150%;
41 }
42 </style>
43 </head>
44 <body>
45 <img src='skins/common/images/mediawiki.png' alt='The MediaWiki logo' />
46
47 <h1>MediaWiki <?php echo $wgVersion ?></h1>
48 <div class='error'>
49 <?php
50 if ( file_exists( 'config/LocalSettings.php' ) ) {
51 echo( "To complete the installation, move <tt>config/LocalSettings.php</tt> to the parent directory." );
52 } else {
53 echo( "Please <a href='config/index.php' title='setup'>setup the wiki</a> first." );
54 }
55 ?>
56
57 </div>
58 </body>
59 </html>
60 <?php
61 die();
62 }
63
64 require_once( './LocalSettings.php' );
65 require_once( 'includes/Setup.php' );
66
67 # The wiki action class
68 require_once ( "includes/Wiki.php" ) ;
69 $wgTheWiki = new MediaWikiType ;
70
71 logProfilingData();
72 $wgLoadBalancer->closeAll();
73 wfDebug( "Request ended normally\n" );
74 ?>