Commit 38092ac0 authored by catch's avatar catch

Issue #2670966 by Crell, alexpott, catch, tstoeckler, cilefen,...

Issue #2670966 by Crell, alexpott, catch, tstoeckler, cilefen, David_Rothstein, Fabianx, webchick, timmillwood, hussainweb, JeroenT, daffie: Warn users of PHP 5.5 and recommend PHP 7
parent 62f81217
......@@ -23,6 +23,18 @@
*/
const DRUPAL_MINIMUM_PHP = '5.5.9';
/**
* Minimum version of PHP receiving security updates.
*
* @see https://secure.php.net/supported-versions.php
*/
const DRUPAL_MINIMUM_SECURE_PHP = '5.6';
/**
* Minimum recommended version of PHP.
*/
const DRUPAL_RECOMMENDED_PHP = '7.0.0';
/**
* Minimum recommended value of PHP memory_limit.
*
......
......@@ -177,11 +177,19 @@ function system_requirements($phase) {
// If PHP is old, it's not safe to continue with the requirements check.
return $requirements;
}
elseif (version_compare($phpversion, DRUPAL_MINIMUM_SECURE_PHP) < 0) {
$requirements['php']['description'] = t('Your PHP installation is running version %version, which is no longer receiving security support from the PHP development team. We recommend upgrading to version %recommended or higher.', ['%version' => $phpversion, '%recommended' => DRUPAL_RECOMMENDED_PHP]);
$requirements['php']['severity'] = REQUIREMENT_WARNING;
}
elseif (version_compare($phpversion, DRUPAL_RECOMMENDED_PHP) < 0) {
$requirements['php']['description'] = t('Your PHP installation is running version %version. We recommend upgrading to version %recommended or higher.', ['%version' => $phpversion, '%recommended' => DRUPAL_RECOMMENDED_PHP]);
$requirements['php']['severity'] = REQUIREMENT_INFO;
}
// Suggest to update to at least 5.5.21 or 5.6.5 for disabling multiple
// statements.
if (($phase === 'install' || \Drupal::database()->driver() === 'mysql') && !SystemRequirements::phpVersionWithPdoDisallowMultipleStatements($phpversion)) {
$requirements['php'] = array(
$requirements['php_mysql'] = array(
'title' => t('PHP (multiple statement disabling)'),
'value' => $phpversion_label,
'description' => t('PHP versions higher than 5.6.5 or 5.5.21 provide built-in SQL injection protection for mysql databases. It is recommended to update.'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment