﻿Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.99
diff -u -p -r1.99 install.php
--- install.php	30 Nov 2007 23:09:14 -0000	1.99
+++ install.php	8 Dec 2007 00:38:53 -0000
@@ -822,6 +822,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.3
diff -u -p -r1.3 theme.maintenance.inc
--- includes/theme.maintenance.inc	6 Dec 2007 09:58:30 -0000	1.3
+++ includes/theme.maintenance.inc	8 Dec 2007 00:38:53 -0000
@@ -125,6 +125,11 @@ 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'])) {
+    $variables['messages'] .= theme('status_messages', 'warning');
+  }
+
   // Special handling of status messages
   if (isset($messages['status'])) {
     $warnings = 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.203
diff -u -p -r1.203 system.install
--- modules/system/system.install	6 Dec 2007 21:35:14 -0000	1.203
+++ modules/system/system.install	8 Dec 2007 00:38:57 -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.559
diff -u -p -r1.559 system.module
--- modules/system/system.module	6 Dec 2007 09:58:33 -0000	1.559
+++ modules/system/system.module	8 Dec 2007 00:38:58 -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
