00001 <?php
00007 if ( !isset( $wgVersion ) ) {
00008 $wgVersion = 'VERSION';
00009 }
00010
00011 $scriptName = $_SERVER['SCRIPT_NAME'];
00012 $ext = substr( $scriptName, strrpos( $scriptName, "." ) + 1 );
00013 $path = '';
00014 # Add any directories in the main folder that could contain an entrypoint (even possibly).
00015 # We cannot just do a dir listing here, as we do not know where it is yet
00016 # These must not also be the names of subfolders that may contain an entrypoint
00017 $topdirs = array( 'extensions', 'includes' );
00018 foreach( $topdirs as $dir ){
00019 # Check whether a directory by this name is in the path
00020 if( strrpos( $scriptName, "/" . $dir . "/" ) ){
00021 # If so, check whether it is the right folder
00022 # First, get the number of directories up it is (to generate path)
00023 $numToGoUp = substr_count( substr( $scriptName, strrpos( $scriptName, "/" . $dir . "/" ) + 1 ), "/" );
00024 # And generate the path using ..'s
00025 for( $i = 0; $i < $numToGoUp; $i++ ){
00026 $realPath = "../" . $realPath;
00027 }
00028 # Checking existance (using the image here as it is something not likely to change, and to always be here)
00029 if( file_exists( $realPath . "skins/common/images/mediawiki.png" ) ) {
00030 # If so, get the path that we can use in this file, and stop looking
00031 $path = substr( $scriptName, 0, strrpos( $scriptName, "/" . $dir . "/" ) + 1 );
00032 break;
00033 }
00034 }
00035 }
00036 ?>
00037 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
00038 <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
00039 <head>
00040 <title>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></title>
00041 <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
00042 <style type='text/css' media='screen, projection'>
00043 html, body {
00044 color: #000;
00045 background-color: #fff;
00046 font-family: sans-serif;
00047 text-align: center;
00048 }
00049
00050 h1 {
00051 font-size: 150%;
00052 }
00053 </style>
00054 </head>
00055 <body>
00056 <img src="<?php echo htmlspecialchars( $path ) ?>skins/common/images/mediawiki.png" alt='The MediaWiki logo' />
00057
00058 <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></h1>
00059 <div class='error'>
00060 <?php
00061 if ( file_exists( 'config/LocalSettings.php' ) ) {
00062 echo( 'To complete the installation, move <tt>config/LocalSettings.php</tt> to the parent directory.' );
00063 } else {
00064 echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\" title='setup'> set up the wiki</a> first." );
00065 }
00066 ?>
00067
00068 </div>
00069 </body>
00070 </html>