* Allow $wgDiff3=false
[lhc/web/wiklou.git] / includes / templates / PHP4.php
1 <?php
2 /**
3 * @file
4 * @ingroup Templates
5 */
6
7 if( isset( $_SERVER['REQUEST_URI'] ) ) {
8 $scriptUrl = $_SERVER['REQUEST_URI'];
9 } elseif( isset( $_SERVER['SCRIPT_NAME'] ) ) {
10 // Probably IIS; doesn't set REQUEST_URI
11 $scriptUrl = $_SERVER['SCRIPT_NAME'];
12 } else {
13 $scriptUrl = '';
14 }
15 if ( preg_match( '!^(.*)/config/[^/]*.php$!', $scriptUrl, $m ) ) {
16 $baseUrl = $m[1];
17 } elseif ( preg_match( '!^(.*)/[^/]*.php$!', $scriptUrl, $m ) ) {
18 $baseUrl = $m[1];
19 } else {
20 $baseUrl = dirname( $baseUrl );
21 }
22
23 ?>
24 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
25 <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
26 <head>
27 <title>MediaWiki <?php echo htmlspecialchars( $wgVersion ); ?></title>
28 <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
29 <style type='text/css' media='screen, projection'>
30 html, body {
31 color: #000;
32 background-color: #fff;
33 font-family: sans-serif;
34 text-align: center;
35 }
36
37 p {
38 text-align: left;
39 margin-left: 2em;
40 margin-right: 2em;
41 }
42
43 h1 {
44 font-size: 150%;
45 }
46 </style>
47 </head>
48 <body>
49 <img src="<?php echo htmlspecialchars( $baseUrl ) ?>/skins/common/images/mediawiki.png" alt='The MediaWiki logo' />
50
51 <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ); ?></h1>
52 <div class='error'>
53 <p>
54 MediaWiki requires PHP 5.0.0 or higher. You are running PHP
55 <?php echo htmlspecialchars( phpversion() ); ?>.
56 </p>
57 <?php
58 flush();
59 /**
60 * Test the *.php5 extension
61 */
62 $downloadOther = true;
63 if ( $baseUrl ) {
64 $testUrl = "$wgServer$baseUrl/extension-test.php5";
65 ini_set( 'allow_url_fopen', '1' );
66 $s = file_get_contents( $testUrl );
67
68 if ( strpos( $s, 'yes' ) !== false ) {
69 $encUrl = htmlspecialchars( str_replace( '.php', '.php5', $scriptUrl ) );
70 echo "<p>You may be able to use MediaWiki using a <a href=\"$encUrl\">.php5</a> file extension.</p>";
71 $downloadOther = false;
72 }
73 }
74 if ( $downloadOther ) {
75 ?>
76 <p>Please consider upgrading your copy of PHP. PHP 4 is at the end of its
77 lifecycle and will not receive further security updates.</p>
78 <p>If for some reason you really really need to run MediaWiki on PHP 4, you will need to
79 <a href="http://www.mediawiki.org/wiki/Download">download version 1.6.x</a>
80 from our website. </p>
81 <?php
82 }
83 ?>
84
85 </div>
86 </body>
87 </html>