00001 <?php
00007 if( !defined( 'MW_PHP4' ) ) {
00008 die( "Not an entry point.");
00009 }
00010
00011 if( isset( $_SERVER['SCRIPT_NAME'] ) ) {
00012
00013 $scriptUrl = $_SERVER['SCRIPT_NAME'];
00014 } elseif( isset( $_SERVER['REQUEST_URI'] ) ) {
00015
00016 $scriptUrl = $_SERVER['REQUEST_URI'];
00017 } else {
00018 $scriptUrl = '';
00019 }
00020 if ( preg_match( '!^(.*)/config/[^/]*.php$!', $scriptUrl, $m ) ) {
00021 $baseUrl = $m[1];
00022 } elseif ( preg_match( '!^(.*)/[^/]*.php$!', $scriptUrl, $m ) ) {
00023 $baseUrl = $m[1];
00024 } else {
00025 $baseUrl = dirname( $scriptUrl );
00026 }
00027
00028 ?>
00029 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
00030 <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
00031 <head>
00032 <title>MediaWiki <?php echo htmlspecialchars( $wgVersion ); ?></title>
00033 <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
00034 <style type='text/css' media='screen, projection'>
00035 html, body {
00036 color: #000;
00037 background-color: #fff;
00038 font-family: sans-serif;
00039 text-align: center;
00040 }
00041
00042 p {
00043 text-align: left;
00044 margin-left: 2em;
00045 margin-right: 2em;
00046 }
00047
00048 h1 {
00049 font-size: 150%;
00050 }
00051 </style>
00052 </head>
00053 <body>
00054 <img src="<?php echo htmlspecialchars( $baseUrl ) ?>/skins/common/images/mediawiki.png" alt='The MediaWiki logo' />
00055
00056 <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ); ?></h1>
00057 <div class='error'>
00058 <p>
00059 MediaWiki requires PHP 5.0.0 or higher. You are running PHP
00060 <?php echo htmlspecialchars( phpversion() ); ?>.
00061 </p>
00062 <?php
00063 flush();
00067 $downloadOther = true;
00068 if ( $baseUrl ) {
00069 $testUrl = "$wgServer$baseUrl/php5.php5";
00070 if( function_exists( 'file_get_contents' ) ) {
00071 $errorLevel = error_reporting();
00072 error_reporting( $errorLevel & !E_WARNING );
00073
00074 ini_set( 'allow_url_fopen', '1' );
00075 $s = file_get_contents( $testUrl );
00076
00077 error_reporting( $errorLevel );
00078 }
00079
00080 if ( strpos( $s, 'yes' ) !== false ) {
00081 $encUrl = htmlspecialchars( str_replace( '.php', '.php5', $scriptUrl ) );
00082 echo "<p>You may be able to use MediaWiki using a <a href=\"$encUrl\">.php5</a> file extension.</p>";
00083 $downloadOther = false;
00084 }
00085 }
00086 if ( $downloadOther ) {
00087 ?>
00088 <p>Please consider
00089 <a href="http://www.php.net/downloads.php">upgrading your copy of PHP</a>.
00090 PHP 4 is at the end of its lifecycle and will not receive further security updates.</p>
00091 <p>If for some reason you really really need to run MediaWiki on PHP 4, you will need to
00092 <a href="http://www.mediawiki.org/wiki/Download">download version 1.6.x</a>
00093 from our website. </p>
00094 <?php
00095 }
00096 ?>
00097
00098 </div>
00099 </body>
00100 </html>