(bug 27781) Pt 2: Check for minimum PHP version in installer (which is seperate from...
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 4 Mar 2011 13:58:40 +0000 (13:58 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 4 Mar 2011 13:58:40 +0000 (13:58 +0000)
INSTALL
RELEASE-NOTES
includes/installer/Installer.i18n.php
includes/installer/Installer.php

diff --git a/INSTALL b/INSTALL
index ec0b7bb..d246c7b 100644 (file)
--- 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
index cf1d167..f6aa977 100644 (file)
@@ -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.
index fdb0e8a..615af42 100644 (file)
@@ -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.
index 39ef84d..dfeb414 100644 (file)
@@ -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;
+                               }
                        }
                }