From 0632a523c0ee5d182cf4d36719cfcf6e278bc0d4 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 30 Jul 2015 08:12:51 -0400 Subject: [PATCH] CRM-16940 - Add php deprecation warning --- CRM/Upgrade/Incremental/General.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CRM/Upgrade/Incremental/General.php b/CRM/Upgrade/Incremental/General.php index 8d85862846..73e5fba1f0 100644 --- a/CRM/Upgrade/Incremental/General.php +++ b/CRM/Upgrade/Incremental/General.php @@ -37,6 +37,7 @@ * This class contains generic upgrade logic which runs regardless of version. */ class CRM_Upgrade_Incremental_General { + const MIN_RECOMMENDED_PHP_VER = '5.5'; /** * Compute any messages which should be displayed before upgrade. @@ -47,6 +48,19 @@ class CRM_Upgrade_Incremental_General { * @param $latestVer */ public static function setPreUpgradeMessage(&$preUpgradeMessage, $currentVer, $latestVer) { + if (version_compare(phpversion(), self::MIN_RECOMMENDED_PHP_VER) < 0) { + $preUpgradeMessage .= '
' . + ts('This webserver is running an outdated version of PHP (%1). The recommended version is %2 or later.', array( + 1 => phpversion(), + 2 => self::MIN_RECOMMENDED_PHP_VER, + )) . + '
' . + ts('You may proceed with the upgrade and CiviCRM %1 will continue working normally, but future releases will require PHP %2.', array( + 1 => $latestVer, + 2 => self::MIN_RECOMMENDED_PHP_VER, + )); + } + // http://issues.civicrm.org/jira/browse/CRM-13572 // Depending on how the code was upgraded, some sites may still have copies of old // source files left behind. This is often a forgivable offense, but it's quite -- 2.25.1