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