7 if ( !isset( $wgVersion ) ) {
8 $wgVersion = 'VERSION';
11 $scriptName = $_SERVER['SCRIPT_NAME'];
12 $ext = substr( $scriptName, strrpos( $scriptName, "." ) +
1 );
14 # Add any directories in the main folder that could contain an entrypoint (even possibly).
15 # We cannot just do a dir listing here, as we do not know where it is yet
16 # These must not also be the names of subfolders that may contain an entrypoint
17 $topdirs = array( 'extensions', 'includes' );
18 foreach( $topdirs as $dir ){
19 # Check whether a directory by this name is in the path
20 if( strrpos( $scriptName, "/" . $dir . "/" ) ){
21 # If so, check whether it is the right folder
22 # First, get the number of directories up it is (to generate path)
23 $numToGoUp = substr_count( substr( $scriptName, strrpos( $scriptName, "/" . $dir . "/" ) +
1 ), "/" );
24 # And generate the path using ..'s
25 for( $i = 0; $i < $numToGoUp; $i++
){
26 $realPath = "../" . $realPath;
28 # Checking existance (using the image here as it is something not likely to change, and to always be here)
29 if( file_exists( $realPath . "skins/common/images/mediawiki.png" ) ) {
30 # If so, get the path that we can use in this file, and stop looking
31 $path = substr( $scriptName, 0, strrpos( $scriptName, "/" . $dir . "/" ) +
1 );
37 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
38 <html xmlns
='http://www.w3.org/1999/xhtml' xml
:lang
='en' lang
='en'>
40 <title
>MediaWiki
<?php
echo htmlspecialchars( $wgVersion ) ?
></title
>
41 <meta http
-equiv
='Content-Type' content
='text/html; charset=utf-8' />
42 <style type
='text/css' media
='screen, projection'>
45 background
-color
: #fff;
46 font
-family
: sans
-serif
;
56 <img src
="<?php echo htmlspecialchars( $path ) ?>skins/common/images/mediawiki.png" alt
='The MediaWiki logo' />
58 <h1
>MediaWiki
<?php
echo htmlspecialchars( $wgVersion ) ?
></h1
>
61 if ( file_exists( 'config/LocalSettings.php' ) ) {
62 echo( 'To complete the installation, move <tt>config/LocalSettings.php</tt> to the parent directory.' );
64 echo( "Please <a href=\"" . htmlspecialchars( $path ) . "config/index." . htmlspecialchars( $ext ) . "\" title='setup'> set up the wiki</a> first." );