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