diff --git a/core/includes/install.inc b/core/includes/install.inc index 391750f..ff4741b 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -1127,6 +1127,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_parse_info_file($profile_file); diff --git a/core/modules/system/system.install b/core/modules/system/system.install index e23bf8e..470cf34 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -21,6 +21,17 @@ function system_requirements($phase) { // Ensure translations don't break during installation. $t = get_t(); + // Get information about the current installation profile. + 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); + } + // Report Drupal version if ($phase == 'runtime') { $requirements['drupal'] = array( @@ -32,15 +43,14 @@ function system_requirements($phase) { // Display the currently active installation profile, if the site // is not running the default installation profile. - $profile = drupal_get_profile(); if ($profile != 'standard') { - $info = system_get_info('module', $profile); + $profile_info = system_get_info('module', $profile); $requirements['install_profile'] = array( 'title' => $t('Installation profile'), 'value' => $t('%profile_name (%profile-%version)', array( - '%profile_name' => $info['name'], + '%profile_name' => $profile_info['name'], '%profile' => $profile, - '%version' => $info['version'] + '%version' => $profile_info['version'] )), 'severity' => REQUIREMENT_INFO, 'weight' => -9 @@ -48,6 +58,7 @@ function system_requirements($phase) { } } + // Web server information. $software = $_SERVER['SERVER_SOFTWARE']; $requirements['webserver'] = array( @@ -72,8 +83,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; @@ -202,16 +213,20 @@ function system_requirements($phase) { 'value' => $memory_limit == -1 ? t('-1 (Unlimited)') : $memory_limit, ); - if (!drupal_check_memory_limit(DRUPAL_MINIMUM_PHP_MEMORY_LIMIT, $memory_limit)) { + if (!isset($profile_info['php_memory_limit'])) { + $profile_info['php_memory_limit'] = DRUPAL_MINIMUM_PHP_MEMORY_LIMIT; + } + + if (!drupal_check_memory_limit($profile_info['php_memory_limit'], $memory_limit)) { $description = ''; if ($phase == 'install') { - $description = $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 = $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 = $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 = $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 = $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 = $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)) {