diff --git a/core/includes/install.inc b/core/includes/install.inc index 7b52cd3..d2b4705 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -1054,6 +1054,7 @@ function install_profile_info($profile, $langcode = 'en') { 'version' => NULL, 'hidden' => FALSE, 'php' => DRUPAL_MINIMUM_PHP, + 'php_memory_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT, ); $profile_file = drupal_get_path('profile', $profile) . "/$profile.info.yml"; $info = \Drupal::service('info_parser')->parse($profile_file); diff --git a/core/modules/system/system.install b/core/modules/system/system.install index de65bb1..ea432fd 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -47,6 +47,16 @@ function system_requirements($phase) { } } + if (isset($GLOBALS['install_state']['profile_info'])) { + $profile_info = $GLOBALS['install_state']['profile_info']; + } + else { + if (!isset($profile)) { + $profile = drupal_get_profile(); + } + $profile_info = install_profile_info($profile); + } + // Web server information. $software = \Drupal::request()->server->get('SERVER_SOFTWARE'); $requirements['webserver'] = array( @@ -72,8 +82,8 @@ function system_requirements($phase) { ); } - if (version_compare($phpversion, DRUPAL_MINIMUM_PHP) < 0) { - $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => DRUPAL_MINIMUM_PHP)); + if (version_compare($phpversion, $profile_info['php']) < 0) { + $requirements['php']['description'] = $t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => $profile_info['php'])); $requirements['php']['severity'] = REQUIREMENT_ERROR; // If PHP is old, it's not safe to continue with the requirements check. return $requirements; @@ -198,13 +208,13 @@ function system_requirements($phase) { if (!Environment::checkMemoryLimit(DRUPAL_MINIMUM_PHP_MEMORY_LIMIT, $memory_limit)) { $description = array(); if ($phase == 'install') { - $description['phase'] = t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the installation process.', array('%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)); + $description['phase'] = t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the installation process.', array('%memory_minimum_limit' => $profile_info['php_memory_limit'])); } elseif ($phase == 'update') { - $description['phase'] = t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the update process.', array('%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)); + $description['phase'] = t('Consider increasing your PHP memory limit to %memory_minimum_limit to help prevent errors in the update process.', array('%memory_minimum_limit' => $profile_info['php_memory_limit'])); } elseif ($phase == 'runtime') { - $description['phase'] = t('Depending on your configuration, Drupal can run with a %memory_limit PHP memory limit. However, a %memory_minimum_limit PHP memory limit or above is recommended, especially if your site uses additional custom or contributed modules.', array('%memory_limit' => $memory_limit, '%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)); + $description['phase'] = t('Depending on your configuration, Drupal can run with a %memory_limit PHP memory limit. However, a %memory_minimum_limit PHP memory limit or above is recommended, especially if your site uses additional custom or contributed modules.', array('%memory_limit' => $memory_limit, '%memory_minimum_limit' => $profile_info['php_memory_limit'])); } if (!empty($description['phase'])) {