]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - includes/templates/NoLocalSettings.php
MediaWiki 1.17.1
[autoinstallsdev/mediawiki.git] / includes / templates / NoLocalSettings.php
1 <?php
2 /**
3  * Template used when there is no LocalSettings.php file
4  *
5  * @file
6  * @ingroup Templates
7  */
8
9 if ( !isset( $wgVersion ) ) {
10         $wgVersion = 'VERSION';
11 }
12
13 $matches = array();
14 $ext = 'php';
15 $path = '/';
16 foreach( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) {
17         if( !preg_match( '/\.(php5?)$/', $part, $matches ) ) {
18                 $path .= "$part/";
19         } else {
20                 $ext = $matches[1] == 'php5' ? 'php5' : 'php';
21         }
22 }
23
24 # Check to see if the installer is running
25 if ( !function_exists( 'session_name' ) ) {
26         $installerStarted = false;
27 } else {
28         session_name( 'mw_installer_session' );
29         $oldReporting = error_reporting( E_ALL & ~E_NOTICE );
30         $success = session_start();
31         error_reporting( $oldReporting );
32         $installerStarted = ( $success && isset( $_SESSION['installData'] ) );
33 }
34 ?>
35 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
36 <html xmlns='http://www.w3.org/1999/xhtml' lang='en'>
37         <head>
38                 <title>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></title>
39                 <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
40                 <style type='text/css' media='screen'>
41                         html, body {
42                                 color: #000;
43                                 background-color: #fff;
44                                 font-family: sans-serif;
45                                 text-align: center;
46                         }
47
48                         h1 {
49                                 font-size: 150%;
50                         }
51                 </style>
52         </head>
53         <body>
54                 <img src="<?php echo htmlspecialchars( $path ) ?>skins/common/images/mediawiki.png" alt='The MediaWiki logo' />
55
56                 <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></h1>
57                 <div class='error'>
58                 <p>LocalSettings.php not found.</p>
59                 <p>
60                 <?php
61                 if ( $installerStarted ) {
62                         echo( "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php." );
63                 } else {
64                         echo( "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first." );
65                 }
66                 ?>
67                 </p>
68
69                 </div>
70         </body>
71 </html>