MediaWiki  REL1_24
NoLocalSettings.php
Go to the documentation of this file.
00001 <?php
00002 // @codingStandardsIgnoreFile
00025 if ( !defined( 'MEDIAWIKI' ) ) {
00026     die( "NoLocalSettings.php is not a valid MediaWiki entry point\n" );
00027 }
00028 
00029 if ( !isset( $wgVersion ) ) {
00030     $wgVersion = 'VERSION';
00031 }
00032 
00033 # bug 30219 : can not use pathinfo() on URLs since slashes do not match
00034 $matches = array();
00035 $ext = 'php';
00036 $path = '/';
00037 foreach ( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) {
00038     if ( !preg_match( '/\.(php5?)$/', $part, $matches ) ) {
00039         $path .= "$part/";
00040     } else {
00041         $ext = $matches[1] == 'php5' ? 'php5' : 'php';
00042     }
00043 }
00044 
00045 # Check to see if the installer is running
00046 if ( !function_exists( 'session_name' ) ) {
00047     $installerStarted = false;
00048 } else {
00049     session_name( 'mw_installer_session' );
00050     $oldReporting = error_reporting( E_ALL & ~E_NOTICE );
00051     $success = session_start();
00052     error_reporting( $oldReporting );
00053     $installerStarted = ( $success && isset( $_SESSION['installData'] ) );
00054 }
00055 ?>
00056 <!DOCTYPE html>
00057 <html lang="en" dir="ltr">
00058     <head>
00059         <meta charset="UTF-8" />
00060         <title>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></title>
00061         <style media='screen'>
00062             html, body {
00063                 color: #000;
00064                 background-color: #fff;
00065                 font-family: sans-serif;
00066                 text-align: center;
00067             }
00068 
00069             h1 {
00070                 font-size: 150%;
00071             }
00072         </style>
00073     </head>
00074     <body>
00075         <img src="<?php echo htmlspecialchars( $path ) ?>resources/assets/mediawiki.png" alt='The MediaWiki logo' />
00076 
00077         <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></h1>
00078         <div class='error'>
00079         <?php if ( !file_exists( MW_CONFIG_FILE ) ) { ?>
00080             <p>LocalSettings.php not found.</p>
00081             <p>
00082             <?php
00083             if ( $installerStarted ) {
00084                 echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\">complete the installation</a> and download LocalSettings.php.";
00085             } else {
00086                 echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\">set up the wiki</a> first.";
00087             }
00088             ?>
00089             </p>
00090         <?php } else { ?>
00091             <p>LocalSettings.php not readable.</p>
00092             <p>Please correct file permissions and try again.</p>
00093         <?php } ?>
00094 
00095         </div>
00096     </body>
00097 </html>