X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FPHPVersionError.php;h=0f5a6fc087877cf23678fccbddcf8afeb9a44137;hb=b2645d82849ca74b0e6b8df6a3e28e81d0561a58;hp=60aa33c07c2512b54e3b48d553ea48d664aaa894;hpb=2e09c356789bf7569fdfa219827f488976aa16f0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/PHPVersionError.php b/includes/PHPVersionError.php index 60aa33c07c..0f5a6fc087 100644 --- a/includes/PHPVersionError.php +++ b/includes/PHPVersionError.php @@ -32,25 +32,34 @@ * - index.php * - load.php * - api.php + * - mw-config/index.php * - cli * * @note Since we can't rely on anything, the minimum PHP versions and MW current * version are hardcoded here */ function wfPHPVersionError( $type ) { - $mwVersion = '1.23'; + $mwVersion = '1.24'; $minimumVersionPHP = '5.3.2'; - $phpVersion = phpversion(); + $phpVersion = PHP_VERSION; $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."; + $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' ) { + $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' || $type == 'mw-config/index.php' ) { $pathinfo = pathinfo( $_SERVER['SCRIPT_NAME'] ); + if ( $type == 'mw-config/index.php' ) { + $dirname = dirname( $pathinfo['dirname'] ); + } else { + $dirname = $pathinfo['dirname']; + } $encLogo = htmlspecialchars( - str_replace( '//', '/', $pathinfo['dirname'] . '/' ) . + str_replace( '//', '/', $dirname . '/' ) . 'skins/common/images/mediawiki.png' );