From: Chad Horohoe Date: Fri, 4 Mar 2011 13:58:40 +0000 (+0000) Subject: (bug 27781) Pt 2: Check for minimum PHP version in installer (which is seperate from... X-Git-Tag: 1.31.0-rc.0~31656 X-Git-Url: http://git.cyclocoop.org/%22%20.%20%20%20%24self2%20.%20%20%20%22&var_mode_affiche=boucle?a=commitdiff_plain;h=7822efac6c305beca4bdb2f2a824715199a70502;p=lhc%2Fweb%2Fwiklou.git (bug 27781) Pt 2: Check for minimum PHP version in installer (which is seperate from the PHP4 check) --- diff --git a/INSTALL b/INSTALL index ec0b7bb905..d246c7b535 100644 --- a/INSTALL +++ b/INSTALL @@ -6,10 +6,10 @@ Starting with MediaWiki 1.2.0, it's possible to install and configure the wiki "in-place", as long as you have the necessary prerequisites available. Required software: -* Web server with PHP 5.1.x or higher. +* Web server with PHP 5.2.x or higher. * A SQL server, the following types are supported ** MySQL 4.0.14 or higher -** PostgreSQL 8.1 or higher +** PostgreSQL 8.3 or higher ** SQLite MediaWiki is developed and tested mainly on Unix/Linux platforms, but should diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cf1d167688..f6aa977ce2 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -18,6 +18,10 @@ will be made on the development trunk and appear in the next quarterly release. Those wishing to use the latest code instead of a branch release can obtain it from source control: http://www.mediawiki.org/wiki/Download_from_SVN +=== PHP 5.2 now required == +In 1.18, the lowest supported version of MediaWiki is now 5.2.x. Please upgrade +PHP if you have not done so prior to upgrading MediaWiki. + === Configuration changes in 1.18 === * The WantedPages::getSQL hook has been removed and replaced with WantedPages::getQueryInfo . This may break older extensions. diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php index fdb0e8aeeb..615af42790 100644 --- a/includes/installer/Installer.i18n.php +++ b/includes/installer/Installer.i18n.php @@ -89,6 +89,8 @@ You can install MediaWiki.', 'config-env-bad' => 'The environment has been checked. You cannot install MediaWiki.', 'config-env-php' => 'PHP $1 is installed.', + 'config-env-php-toolow' => 'PHP $1 is installed. +However, MediaWiki requires PHP $2 or higher.', 'config-unicode-using-utf8' => 'Using Brion Vibber\'s utf8_normalize.so for Unicode normalization.', 'config-unicode-using-intl' => 'Using the [http://pecl.php.net/intl intl PECL extension] for Unicode normalization.', 'config-unicode-pure-php-warning' => "'''Warning''': The [http://pecl.php.net/intl intl PECL extension] is not available to handle Unicode normalization, falling back to slow pure-PHP implementation. diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 39ef84de08..dfeb414949 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -23,6 +23,9 @@ */ abstract class Installer { + // This is the absolute minimum PHP version we can support + const MINIMUM_PHP_VERSION = '5.2.0'; + /** * @var array */ @@ -363,14 +366,21 @@ abstract class Installer { * @return Status */ public function doEnvironmentChecks() { - $this->showMessage( 'config-env-php', phpversion() ); - - $good = true; + $phpVersion = phpversion(); + if( version_compare( $phpVersion, self::MINIMUM_PHP_VERSION, '>=' ) ) { + $this->showMessage( 'config-env-php', $phpVersion ); + $good = true; + } else { + $this->showMessage( 'config-env-php-toolow', $phpVersion, self::MINIMUM_PHP_VERSION ); + $good = false; + } - foreach ( $this->envChecks as $check ) { - $status = $this->$check(); - if ( $status === false ) { - $good = false; + if( $good ) { + foreach ( $this->envChecks as $check ) { + $status = $this->$check(); + if ( $status === false ) { + $good = false; + } } }