X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FPHPVersionError.php;h=02d3546fbea66314f92f254f8c9dde4cde65c660;hb=1afc53f3782882faa79fd2b819bc4002a950b1df;hp=36a503a05757adf46e77df3db38d72cb95fd6b73;hpb=dac3d8d7f28059ba7b30b4b74a5c0ec575c5854a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/PHPVersionError.php b/includes/PHPVersionError.php index 36a503a057..02d3546fbe 100644 --- a/includes/PHPVersionError.php +++ b/includes/PHPVersionError.php @@ -38,28 +38,35 @@ * version are hardcoded here */ function wfPHPVersionError( $type ) { - $mwVersion = '1.21'; - $phpVersion = PHP_VERSION; - $message = "MediaWiki $mwVersion requires at least PHP version 5.3.2, you are using PHP $phpVersion."; - if( $type == 'index.php' ) { + $mwVersion = '1.22'; + $minimumVersionPHP = '5.3.2'; + + $phpVersion = phpversion(); + $protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0'; + $message = "MediaWiki $mwVersion requires at least PHP version $minimumVersionPHP, you are using PHP $phpVersion."; + if ( $type == 'cli' ) { + $finalOutput = "You are using PHP version $phpVersion but MediaWiki $mwVersion needs PHP $minimumVersionPHP or higher. ABORTING.\n" . + "Check if you have a newer php executable with a different name, such as php5.\n"; + } elseif ( $type == 'index.php' ) { + $pathinfo = pathinfo( $_SERVER['SCRIPT_NAME'] ); $encLogo = htmlspecialchars( - str_replace( '//', '/', pathinfo( $_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME ) . '/' - ) . 'skins/common/images/mediawiki.png' + str_replace( '//', '/', $pathinfo['dirname'] . '/' ) . + 'skins/common/images/mediawiki.png' ); - header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500 ); + header( "$protocol 500 MediaWiki configuration Error" ); header( 'Content-type: text/html; charset=UTF-8' ); // Don't cache error pages! They cause no end of trouble... header( 'Cache-control: none' ); - header( 'Pragma: nocache' ); + header( 'Pragma: no-cache' ); $finalOutput = << - + + + MediaWiki {$mwVersion} - -