diff --git a/includes/install.inc b/includes/install.inc index 6411f8f..9e81a54 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -1264,6 +1264,7 @@ function install_profile_info($profile, $locale = 'en') { 'version' => NULL, 'hidden' => FALSE, 'php' => DRUPAL_MINIMUM_PHP, + 'php_memory_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT, ); $info = drupal_parse_info_file("profiles/$profile/$profile.info") + $defaults; $info['dependencies'] = array_unique(array_merge( diff --git a/modules/system/system.install b/modules/system/system.install index 220dfee..c3367b6 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -45,6 +45,15 @@ 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 = $_SERVER['SERVER_SOFTWARE']; @@ -70,8 +79,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; @@ -208,16 +217,16 @@ function system_requirements($phase) { 'value' => $memory_limit == -1 ? t('-1 (Unlimited)') : $memory_limit, ); - if ($memory_limit && $memory_limit != -1 && parse_size($memory_limit) < parse_size(DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)) { + if ($memory_limit && $memory_limit != -1 && parse_size($memory_limit) < parse_size($profile_info['php_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)) {