* 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.
*
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,
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'
);
}