81754586458eb15cfea086c4489f4485563bcf15
[lhc/web/wiklou.git] / includes / templates / NoLocalSettings.php
1 <?php
2 /**
3 * Template used when there is no LocalSettings.php file.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
19 *
20 * @file
21 * @ingroup Templates
22 */
23
24 if ( !defined( 'MEDIAWIKI' ) ) {
25 die( "NoLocalSettings.php is not a valid MediaWiki entry point\n" );
26 }
27
28 if ( !isset( $wgVersion ) ) {
29 $wgVersion = 'VERSION';
30 }
31
32 # bug 30219 : can not use pathinfo() on URLs since slashes do not match
33 $matches = array();
34 $ext = 'php';
35 $path = '/';
36 foreach( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) {
37 if( !preg_match( '/\.(php5?)$/', $part, $matches ) ) {
38 $path .= "$part/";
39 } else {
40 $ext = $matches[1] == 'php5' ? 'php5' : 'php';
41 }
42 }
43
44 # Check to see if the installer is running
45 if ( !function_exists( 'session_name' ) ) {
46 $installerStarted = false;
47 } else {
48 session_name( 'mw_installer_session' );
49 $oldReporting = error_reporting( E_ALL & ~E_NOTICE );
50 $success = session_start();
51 error_reporting( $oldReporting );
52 $installerStarted = ( $success && isset( $_SESSION['installData'] ) );
53 }
54 ?>
55 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
56 <html xmlns='http://www.w3.org/1999/xhtml' lang='en'>
57 <head>
58 <title>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></title>
59 <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
60 <style type='text/css' media='screen'>
61 html, body {
62 color: #000;
63 background-color: #fff;
64 font-family: sans-serif;
65 text-align: center;
66 }
67
68 h1 {
69 font-size: 150%;
70 }
71 </style>
72 </head>
73 <body>
74 <img src="<?php echo htmlspecialchars( $path ) ?>skins/common/images/mediawiki.png" alt='The MediaWiki logo' />
75
76 <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></h1>
77 <div class='error'>
78 <p>LocalSettings.php not found.</p>
79 <p>
80 <?php
81 if ( $installerStarted ) {
82 echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php.";
83 } else {
84 echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first.";
85 }
86 ?>
87 </p>
88
89 </div>
90 </body>
91 </html>