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