Per Nikerabbit, fix undefined variable notice from r102851
[lhc/web/wiklou.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 # bug 30219 : can not use pathinfo() on URLs since slashes do not match
14 $matches = array();
15 $ext = 'php';
16 $path = '/';
17 foreach( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) {
18 if( !preg_match( '/\.(php5?)$/', $part, $matches ) ) {
19 $path .= "$part/";
20 } else {
21 $ext = $matches[1] == 'php5' ? 'php5' : 'php';
22 }
23 }
24
25 # Check to see if the installer is running
26 if ( !function_exists( 'session_name' ) ) {
27 $installerStarted = false;
28 } else {
29 session_name( 'mw_installer_session' );
30 $oldReporting = error_reporting( E_ALL & ~E_NOTICE );
31 $success = session_start();
32 error_reporting( $oldReporting );
33 $installerStarted = ( $success && isset( $_SESSION['installData'] ) );
34 }
35 ?>
36 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
37 <html xmlns='http://www.w3.org/1999/xhtml' lang='en'>
38 <head>
39 <title>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></title>
40 <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
41 <style type='text/css' media='screen'>
42 html, body {
43 color: #000;
44 background-color: #fff;
45 font-family: sans-serif;
46 text-align: center;
47 }
48
49 h1 {
50 font-size: 150%;
51 }
52 </style>
53 </head>
54 <body>
55 <img src="<?php echo htmlspecialchars( $path ) ?>skins/common/images/mediawiki.png" alt='The MediaWiki logo' />
56
57 <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></h1>
58 <div class='error'>
59 <p>LocalSettings.php not found.</p>
60 <p>
61 <?php
62 if ( $installerStarted ) {
63 echo( "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php." );
64 } else {
65 echo( "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first." );
66 }
67 ?>
68 </p>
69
70 </div>
71 </body>
72 </html>