﻿Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.100
diff -u -p -r1.100 install.php
--- install.php	8 Dec 2007 15:15:25 -0000	1.100
+++ install.php	8 Dec 2007 21:06:54 -0000
@@ -874,6 +874,11 @@ function install_check_requirements($pro
       }
     }
   }
+  
+  //If there is a PHP memory limit warning, report it.
+  if($requirements['php_memory_limit'] && $requirements['php_memory_limit']['severity'] == REQUIREMENT_WARNING) {
+    drupal_set_message($requirements['php_memory_limit']['description'], 'warning');
+  }
 
   // If Drupal is not set up already, we also need to create a settings file.
   if (!$verify) {
Index: includes/theme.maintenance.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.maintenance.inc,v
retrieving revision 1.5
diff -u -p -r1.5 theme.maintenance.inc
--- includes/theme.maintenance.inc	8 Dec 2007 15:15:25 -0000	1.5
+++ includes/theme.maintenance.inc	8 Dec 2007 21:06:55 -0000
@@ -125,6 +125,13 @@ function theme_install_page($content) {
     $variables['content'] .= '<p>'. st('Please check the error messages and <a href="!url">try again</a>.', array('!url' => request_uri())) .'</p>';
   }
 
+  // Special handling of warning messages
+  if (isset($messages['warning'])) {
+    $title = count($messages['status']) > 1 ? st('The following installation warnings should be carefully reviewed') : st('The following installation warning should be carefully reviewed');
+    $variables['messages'] .= '<h4>'. $title .':</h4>';
+    $variables['messages'] .= theme('status_messages', 'warning');
+  }
+
   // Special handling of status messages
   if (isset($messages['status'])) {
     $title = count($messages['status']) > 1 ? st('The following installation warnings should be carefully reviewed, but in most cases may be safely ignored') : st('The following installation warning should be carefully reviewed, but in most cases may be safely ignored');
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.204
diff -u -p -r1.204 system.install
--- modules/system/system.install	7 Dec 2007 11:55:13 -0000	1.204
+++ modules/system/system.install	8 Dec 2007 21:07:01 -0000
@@ -58,6 +58,18 @@ function system_requirements($phase) {
     $requirements['php']['severity'] = REQUIREMENT_ERROR;
   }
 
+  // Test PHP memory_limit
+  if ($phase == 'install') {
+    $requirements['php_memory_limit'] = array(
+      'title' => $t('PHP Memory Limit'),
+      'value' => ini_get('memory_limit') ? ini_get('memory_limit') : '',
+    );
+    if (ini_get('memory_limit') && parse_size(ini_get('memory_limit')) < parse_size(DRUPAL_MINIMUM_PHP_MEMORY_LIMIT)) {
+      $requirements['php_memory_limit']['description'] = $t('Your PHP memory limit is set to %memory_limit. Consider increasing this to %memory_minimum_limit or above to ensure a successful installation process, see <a href="@url">http://drupal.org/requirements</a> for further details.', array('%memory_limit' => ini_get('memory_limit'), '%memory_minimum_limit' => DRUPAL_MINIMUM_PHP_MEMORY_LIMIT, '@url' => 'http://drupal.org/requirements'));
+      $requirements['php_memory_limit']['severity'] = REQUIREMENT_WARNING;
+    }
+  }
+
   // Test DB version
   global $db_type;
   if (function_exists('db_status_report')) {
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.560
diff -u -p -r1.560 system.module
--- modules/system/system.module	8 Dec 2007 14:06:22 -0000	1.560
+++ modules/system/system.module	8 Dec 2007 21:07:04 -0000
@@ -10,6 +10,7 @@ define('VERSION', '6.0-dev');
 define('DRUPAL_CORE_COMPATIBILITY', '6.x');
 
 define('DRUPAL_MINIMUM_PHP',    '4.3.3');
+define('DRUPAL_MINIMUM_PHP_MEMORY_LIMIT',    '16M');
 define('DRUPAL_MINIMUM_MYSQL',  '4.1.0'); // If using MySQL
 define('DRUPAL_MINIMUM_PGSQL',  '7.4');   // If using PostgreSQL
 define('DRUPAL_MINIMUM_APACHE', '1.3');   // If using Apache
