Merge "Provide RequestContext from fixDoubleRedirects"
[lhc/web/wiklou.git] / includes / templates / NoLocalSettings.php
index 0006df4..d5b8d8b 100644 (file)
@@ -33,8 +33,8 @@ if ( !isset( $wgVersion ) ) {
 $matches = array();
 $ext = 'php';
 $path = '/';
-foreach( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) {
-       if( !preg_match( '/\.(php5?)$/', $part, $matches ) ) {
+foreach ( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) {
+       if ( !preg_match( '/\.(php5?)$/', $part, $matches ) ) {
                $path .= "$part/";
        } else {
                $ext = $matches[1] == 'php5' ? 'php5' : 'php';
@@ -75,16 +75,21 @@ if ( !function_exists( 'session_name' ) ) {
 
                <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></h1>
                <div class='error'>
-               <p>LocalSettings.php not found.</p>
-               <p>
-               <?php
-               if ( $installerStarted ) {
-                       echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php.";
-               } else {
-                       echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first.";
-               }
-               ?>
-               </p>
+               <?php if ( !file_exists( MW_CONFIG_FILE ) ) { ?>
+                       <p>LocalSettings.php not found.</p>
+                       <p>
+                       <?php
+                       if ( $installerStarted ) {
+                               echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php.";
+                       } else {
+                               echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first.";
+                       }
+                       ?>
+                       </p>
+               <?php } else { ?>
+                       <p>LocalSettings.php not readable.</p>
+                       <p>Please correct file permissions and try again.</p>
+               <?php } ?>
 
                </div>
        </body>