CRM-19404 - Re-allow installation on 5.3.4, but include warning.
authorTim Otten <totten@civicrm.org>
Sat, 24 Sep 2016 17:13:17 +0000 (13:13 -0400)
committerTim Otten <totten@civicrm.org>
Sat, 24 Sep 2016 17:40:13 +0000 (13:40 -0400)
CRM/Upgrade/Incremental/General.php
CRM/Utils/Check/Component/Env.php
install/index.php

index 28a6955d0705e1858e048004d14f16ecb5029a20..2efad44880273f1409122b93514a7d6b1645c764 100644 (file)
  * This class contains generic upgrade logic which runs regardless of version.
  */
 class CRM_Upgrade_Incremental_General {
+
+  /**
+   * The recommended PHP version.
+   */
   const MIN_RECOMMENDED_PHP_VER = '5.5';
-  const BARE_MIN_PHP_VER = '5.3.23';
+
+  /**
+   * The minimum PHP version required to install Civi.
+   *
+   * @see install/index.php
+   */
+  const MIN_INSTALL_PHP_VER = '5.3.4';
+
+  /**
+   * The minimum PHP version required to avoid known
+   * limits or defects.
+   */
+  const MIN_DEFECT_PHP_VER = '5.3.23';
+
   /**
    * Compute any messages which should be displayed before upgrade.
    *
index 10465791d4ccd58ce364d81b6dc26873eba9297b..2a370562eba07792e5e92b6f028908b5b3485ebe 100644 (file)
@@ -38,14 +38,27 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
   public function checkPhpVersion() {
     $messages = array();
 
-    if (version_compare(phpversion(), CRM_Upgrade_Incremental_General::MIN_RECOMMENDED_PHP_VER) < 0) {
+    if (version_compare(phpversion(), CRM_Upgrade_Incremental_General::MIN_RECOMMENDED_PHP_VER) >= 0) {
       $messages[] = new CRM_Utils_Check_Message(
         __FUNCTION__,
-        ts('This system uses PHP version %1. While this meets the minimum requirements for CiviCRM to function, upgrading to PHP version %2 or newer is recommended for maximum compatibility. The bare minimum php version is %3',
+        ts('This system uses PHP version %1 which meets or exceeds the minimum recommendation of %2.',
           array(
             1 => phpversion(),
             2 => CRM_Upgrade_Incremental_General::MIN_RECOMMENDED_PHP_VER,
-            3 => CRM_Upgrade_Incremental_General::BARE_MIN_PHP_VER,
+          )),
+        ts('PHP Up-to-Date'),
+        \Psr\Log\LogLevel::INFO,
+        'fa-server'
+      );
+    }
+    elseif (version_compare(phpversion(), CRM_Upgrade_Incremental_General::MIN_DEFECT_PHP_VER) >= 0) {
+      $messages[] = new CRM_Utils_Check_Message(
+        __FUNCTION__,
+        ts('This system uses PHP version %1. While this meets the minimum requirements for CiviCRM to function, upgrading to PHP version %2 or newer is recommended for maximum compatibility.',
+          array(
+            1 => phpversion(),
+            2 => CRM_Upgrade_Incremental_General::MIN_RECOMMENDED_PHP_VER,
+            3 => CRM_Upgrade_Incremental_General::MIN_DEFECT_PHP_VER,
           )),
         ts('PHP Out-of-Date'),
         \Psr\Log\LogLevel::NOTICE,
@@ -55,13 +68,14 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
     else {
       $messages[] = new CRM_Utils_Check_Message(
         __FUNCTION__,
-        ts('This system uses PHP version %1 which meets or exceeds the minimum recommendation of %2.',
+        ts('This system uses PHP version %1. CiviCRM can be installed on this version, but some specific features are known to fail or degrade. Version %3 is the bare minimum to avoid known issues, and version %2 is recommended.',
           array(
             1 => phpversion(),
             2 => CRM_Upgrade_Incremental_General::MIN_RECOMMENDED_PHP_VER,
+            3 => CRM_Upgrade_Incremental_General::MIN_DEFECT_PHP_VER,
           )),
-        ts('PHP Up-to-Date'),
-        \Psr\Log\LogLevel::INFO,
+        ts('PHP Out-of-Date'),
+        \Psr\Log\LogLevel::WARNING,
         'fa-server'
       );
     }
index 381d59c8b1ccd38b3b8ba2a4865e5d4b6c2bb925..a98269e903b754073e09bccf4a5b72d23cda7d8c 100644 (file)
@@ -557,7 +557,8 @@ class InstallRequirements {
 
     $this->errors = NULL;
 
-    $this->requirePHPVersion('5.3.23', array(
+    // See also: CRM_Upgrade_Incremental_General::MIN_INSTALL_PHP_VER
+    $this->requirePHPVersion('5.3.4', array(
       ts("PHP Configuration"),
       ts("PHP5 installed"),
       NULL,