--- install.php.orig	2006-02-18 17:01:52.000000000 -0500
+++ install.php	2006-02-20 09:10:35.000000000 -0500
@@ -0,0 +1,9 @@
+<?php
+
+global $install;
+$install = TRUE;
+
+require_once './includes/install.inc';
+drupal_install(INSTALL_COMPLETE);
+
+?>
--- includes/install.inc.orig	2006-02-16 09:18:41.000000000 -0500
+++ includes/install.inc	2006-02-20 09:44:55.000000000 -0500
@@ -4,15 +4,41 @@
 define('SCHEMA_UNINSTALLED', -1);
 define('SCHEMA_INSTALLED', 0);
 
+define('DRUPAL_MINIMUM_PHP',    '4.3.3');
+define('DRUPAL_MINIMUM_MEMORY', '8M');
+define('DRUPAL_MINIMUM_MYSQL',  '3.23'); // if using MySQL
+define('DRUPAL_MINIMUM_PGSQL',  '7.3');  // if using PostgreSQL
+define('DRUPAL_MINIMUM_APACHE', '1.3');  // if using Apache
 
-// The system module (Drupal core) is currently a special case
-include_once './database/updates.inc';
+define('FILE_EXIST',          1);
+define('FILE_READABLE',       2);
+define('FILE_WRITEABLE',      4);
+define('FILE_EXECUTABLE',     8);
+define('FILE_NOT_EXIST',      16);
+define('FILE_NOT_READABLE',   32);
+define('FILE_NOT_WRITEABLE',  64);
+define('FILE_NOT_EXECUTABLE', 128);
 
-// Include install files for each module
-foreach (module_list() as $module) {
-  $install_file = './'. drupal_get_path('module', $module) .'/'. $module .'.install';
-  if (is_file($install_file)) {
-    include_once $install_file;
+define('INSTALL_BOOTSTRAP_ENVIRONMENT', 0);
+define('INSTALL_BOOTSTRAP_SETTINGS', 1);
+define('INSTALL_BOOTSTRAP_DATABASE', 2);
+define('INSTALL_PROFILES', 3);
+define('INSTALL_COMPLETE', 4);
+
+if (!$install) {
+  // The system module (Drupal core) is currently a special case
+  include_once './database/updates.inc';
+
+  // Include install files for each module
+  foreach (module_list() as $module) {
+    $install_file = './'. drupal_get_path('module', $module) .'/'. $module .'.install';
+    if (is_file($install_file)) {
+      include_once $install_file;
+      $func = $module .'_requirements_pre';
+      if (function_exists($func)) {
+        drupal_verify_install($func());
+      }
+    }
   }
 }
 
@@ -79,3 +105,406 @@
 function drupal_set_installed_schema_version($module, $version) {
   db_query("UPDATE {system} SET schema_version = %d WHERE name = '%s'", $version, $module);
 }
+
+/**
+ * The Drupal installation happens in a series of steps.  We begin by verifying
+ * that the current environment meets our minimum requirements.  We then go
+ * on to verify that settings.php is properly configured.  From there we
+ * connect to the configured database and verify that it meets our minimum
+ * requirements.  Finally we can allow the user to select an installation 
+ * profile and complete the installation process.
+ *
+ * @param $phase
+ *  The installation phase we should proceed to.
+ */
+function drupal_install($phase) {
+  static $phases = array(INSTALL_BOOTSTRAP_ENVIRONMENT, INSTALL_BOOTSTRAP_SETTINGS, INSTALL_BOOTSTRAP_DATABASE, INSTALL_PROFILES, INSTALL_COMPLETE);
+
+  while (!is_null($current_phase = array_shift($phases))) {
+    _drupal_install($current_phase);
+    if ($phase == $current_phase) {
+      return;
+    }
+  }
+}
+
+/**
+ * The individual Drupal installation phase definitions.
+ *
+ * @param $phase
+ *   The current phase.
+ */
+function _drupal_install($phase) {
+  switch ($phase) {
+    case INSTALL_BOOTSTRAP_ENVIRONMENT:
+      // initial install environment tests
+      require_once './includes/install.inc';
+      require_once './includes/bootstrap.inc';
+      require_once './modules/system.install';
+      drupal_verify_install(system_requirements_bootstrap());
+      if (_install_errors()) {
+        drupal_maintenance_theme();
+        drupal_set_title('Unsupported install environment');
+        print theme('install_page', '<p>The above errors must be resolved before you can install Drupal.  Find additional information about Drupal\'s minimum system requirements <a href="http://drupal.org/node/270">here</a>.</p>');
+        exit;
+      }
+      break;
+
+    case INSTALL_BOOTSTRAP_SETTINGS:
+      // configure/verify settings.php
+      break;
+
+    case INSTALL_BOOTSTRAP_DATABASE:
+      // establish connection to the database
+      break;
+
+    case INSTALL_PROFILES:
+      // select from install profiles and/or specific modules/themes
+      // (gets instructions from *.install and *.profile files)
+      break;
+
+    case INSTALL_COMPLETE:
+      // installation finished, display friendly message with instructions of
+      // how to access/administer the site.
+      drupal_maintenance_theme();
+      drupal_set_title('Drupal installation complete');
+      print theme('install_page', '<p>Drupal has been succesfully installed.');
+      break;
+  }
+}
+
+/**
+ * Check if there are any errors at this point in the installation process.
+ *
+ * @return
+ *  An array of errors, if any.
+ */
+function _install_errors() {
+  $messages = drupal_set_message();
+  return $messages['error'];
+}
+
+/**
+ * Auto detect the base_url with PHP predefined variables.
+ *
+ * @param $file
+ *  The name of the file calling this function so we can strip it out of 
+ *  the URI when generating the base_url.
+ *
+ * @return
+ *  The auto-detected $base_url that should be configured in settings.php
+ */
+function drupal_detect_baseurl($file = 'index.php') {
+  $proto = $_SERVER['HTTPS'] ? 'https://' : 'http://';
+  $host = $_SERVER['SERVER_NAME'];
+  $port = ($_SERVER['SERVER_PORT'] == 80 ? '' : ':'. $_SERVER['SERVER_PORT']);
+  $dir = preg_replace("$/$file$", '', $_SERVER['REQUEST_URI']);
+  return "$proto$host$port$dir";
+}
+
+/**
+ * Detect all databases supported by Drupal that are compiled into the current
+ * PHP installation.
+ *
+ * @param $type
+ *  Optionally specify a type if wish to check if specific database type is
+ *  available.
+ * 
+ * @return
+ *  An array of database types compiled into PHP, or TRUE/FALSE if a database
+ *  type was specified when calling the function.
+ */
+function drupal_detect_database_types($type = NULL) {
+  $databases = array();
+
+  if (function_exists(mysql_connect)) {
+    if ($type == 'mysql') {
+      return TRUE;
+    }
+    $databases[] = 'mysql';
+  }
+  if (function_exists(mysqli_connect)) {
+    if ($type == 'mysqli') {
+      return TRUE;
+    }
+    $databases[] = 'mysqli';
+  }
+  if (function_exists(pg_connect)) {
+    if ($type == 'pgsql') {
+      return TRUE;
+    }
+    $databases[] = 'pgsql';
+  }
+
+  return $databases;
+}
+
+/**
+ * Call the appropriate installation function.  If the function is not 
+ * available, attempt to load the appropriate include file then try again.
+ *
+ * @param $settings
+ *  An array of settings options.
+ */
+function drupal_verify_install($settings = array()) {
+  foreach ($settings as $type => $data) {
+    $function = "drupal_verify_install_$type";
+    if (function_exists("$function")) {
+      $function($data);
+    }
+    else {
+      $include = './includes/install.'. $type .'.inc';
+      if (file_exists($include)) {
+        require_once($include);
+        if (function_exists("$function")) {
+          $function($data);
+        }
+        else {
+          drupal_set_message(strtr('Installation error: function "%function" does not exist.', array('%function' => $function)), 'error');
+        }
+      }
+      else {
+        drupal_set_message(strtr('Installation error: unable to find file "%file", function "%function" does not exist.', array('%file' => $include, '%function' => $function)), 'error');
+      }
+    }
+  }
+}
+
+/**
+ * Some php.ini options are written in shorthand (ie 1K instead of 1024 bytes).
+ * This function converts php.ini shorthand into bytes.
+ *
+ * @param $shorthand
+ *  A memory string in php.ini shorthand notation (ie 1K, 8M, 10G)
+ *
+ * @return
+ *  The shorthand value converted to bytes.
+ */
+function drupal_shorthand_to_bytes($shorthand) {
+  $result = trim($shorthand);
+  $modifier = strtolower($result{strlen($result)-1});
+  switch ($modifier) {
+    case 'g':
+      $result *= 1024;
+    case 'm':
+      $result *= 1024;
+    case 'k':
+      $result *= 1024;
+  }
+  return $result;
+}
+
+/**
+ * Verify that the installed version of PHP meets our minimum requirements.
+ *
+ * @param $version
+ *   An array with some or all of the following directives:
+ *    'required_version' = the required version of PHP
+ *    'message'        = message to display if version is invalid
+ *                       ("%required_version" and "%installed_version" will be
+ *                        automatically replaced if included in the message
+ *                        text.)
+ *    'message_type'   = message type (ie, 'error', 'status')
+ */
+function drupal_verify_version_php($version = array()) {
+  if (!function_exists(version_compare) || 
+      version_compare(phpversion(), $version['required_version'], '<')) {
+    // version_compare() was added in PHP 4.1.
+    $message_type = $version['message_type'] ? $version['message_type'] : 'status';
+    drupal_set_message(strtr($version['message'], array('%required_version' => $version['required_version'], '%installed_version' => phpversion())), $message_type);
+  }
+}
+
+/**
+ * Verify the value of the specified configuration option as found in php.ini.
+ *
+ * @param $setting
+ *   An array with some or all of the following directives:
+ *    'required_value' = the required value of the configuration option
+ *    'shorthand'      = TRUE/FALSE whether the option is in shorthand notation
+ *    'operator'       = optional comparison operator
+ *    'message'        = message to display if comparison fails
+ *                       ("%required_value" and "%current_value" will be
+ *                        automatically replaced if included in the message
+ *                        text.)
+ *    'message_type'   = message type (ie, 'error', 'status')
+ */
+function drupal_verify_install_php($settings = array()) {
+  foreach ($settings as $setting => $data) {
+    // handle special case (not from php.ini)
+    if ($setting == 'version') {
+      drupal_verify_version_php($data);
+    }
+    else {
+      if ($data['shorthand']) {
+        $required = drupal_shorthand_to_bytes($data['required_value']);
+        $current = drupal_shorthand_to_bytes(ini_get($setting));
+      }
+      else {
+        $required = $data['required_value'];
+        $current = ini_get($setting);
+      }
+  
+      switch ($data['operator']) {
+        case '<':
+          $valid = ($current < $required);
+          break;
+        case '<=':
+          $valid = ($current <= $required);
+          break;
+        case '==':
+        default:
+          $valid = ($current == $required);
+          break;
+        case '>=':
+          $valid = ($current >= $required);
+          break;
+        case '>':
+          $valid = ($current > $required);
+          break;
+        case '!=':
+        case '<>':
+          $valid = ($current != $required);
+          break;
+        case '===':
+          $valid = ($current === $required);
+          break;
+        case '!==':
+          $valid = ($current !== $required);
+          break;
+      }
+
+      if (!$valid && isset($data['message'])) {
+        $message_type = $data['message_type'] ? $data['message_type'] : 'status';
+        drupal_set_message(strtr($data['message'], array('%current_value' => ini_get($setting), '%required_value' => $data['required_value'])), $message_type);
+      }
+    }
+  }
+}
+
+/**
+ * Verify the state of the specified file.
+ *
+ * @param $setting
+ *   An array with some or all of the following directives:
+ *    'required'     = whether or not this file is required
+ *    'mask'         = permissions information about the file
+ *    'type'         = file type (file, directory, link)
+ *    'message'      = message to display if something is wrong with file
+ *                     ("%required_value" and "%current_value" will be
+ *                      automatically replaced if included in the message
+ *                      text.)
+ *    'message_type' = message type (ie, 'error', 'status')
+ */
+function drupal_verify_install_file($settings = array()) {
+  foreach ($settings as $file => $data) {
+    $err = FALSE;
+    $message_type = ($data['required'] ? 'error' : 'status');
+    if (isset($data['mask']) && $data['mask'] & FILE_NOT_EXIST) {
+      if (file_exists($file)) {
+        drupal_set_message(strtr('%type "%file" exists but should not.', array('%type' => $data['type'], '%file' => $file)), $message_type);
+        $err = TRUE;
+      }
+    }
+    else {
+      if (isset($data['type']) && file_exists($file)) {
+        switch ($data['type']) {
+          case 'file':
+            if (!is_file($file)) {
+              $err = TRUE;
+            }
+            break;
+          case 'directory':
+            if (!is_dir($file)) {
+              $err = TRUE;
+            }
+            break;
+          case 'link':
+            if (!is_link($file)) {
+              $err = TRUE;
+            }
+            break;
+        }
+        if ($err) {
+          drupal_set_message(strtr('"%file" exists but is not a %type.', array('%type' => $data['type'], '%file' => $file)), $message_type);
+        }
+      }
+
+      if (isset($data['mask'])) {
+        $filetype = ucfirst($data['type']);
+        $masks = array(FILE_EXIST, FILE_READABLE, FILE_WRITEABLE, FILE_EXECUTABLE, FILE_NOT_EXIST, FILE_NOT_READABLE, FILE_NOT_WRITEABLE, FILE_NOT_EXECUTABLE);
+        foreach ($masks as $mask) {
+          if ($data['mask'] & $mask && !$err) {
+            switch ($mask) {
+              case FILE_EXIST:
+                if (!file_exists($file)) {
+                  drupal_set_message(strtr('%type "%file" does not exist.', array('%type' => $filetype, '%file' => $file)), $message_type);
+                  $err = TRUE;
+                }
+                break;
+              case FILE_READABLE:
+                if (!is_readable($file)) {
+                  drupal_set_message(strtr('%type "%file" is not readable.', array('%type' => $filetype, '%file' => $file)), $message_type);
+                  $err = TRUE;
+                }
+                break;
+              case FILE_WRITEABLE:
+                if (!is_writeable($file)) {
+                  drupal_set_message(strtr('%type "%file" is not writeable.', array('%type' => $filetype, '%file' => $file)), $message_type);
+                  $err = TRUE;
+                }
+                break;
+              case FILE_EXECUTABLE:
+                if (!is_executable($file)) {
+                  drupal_set_message(strtr('%type "%file" is not executable.', array('%type' => $filetype, '%file' => $file)), $message_type);
+                  $err = TRUE;
+                }
+                break;
+              case FILE_NOT_READABLE:
+                if (is_readable($file)) {
+                  drupal_set_message(strtr('%type "%file" is readable but should not be.', array('%type' => $filetype, '%file' => $file)), $message_type);
+                  $err = TRUE;
+                }
+                break;
+              case FILE_NOT_WRITEABLE:
+                if (is_writeable($file)) {
+                  drupal_set_message(strtr('%type "%file" is writeable but should not be.', array('%type' => $filetype, '%file' => $file)), $message_type);
+                  $err = TRUE;
+                }
+                break;
+              case FILE_NOT_EXECUTABLE:
+                if (is_executable($file)) {
+                  drupal_set_message(strtr('%type "%file" is executable but should not be.', array('%type' => $filetype, '%file' => $file)), $message_type);
+                  $err = TRUE;
+                }
+                break;
+            }
+          }
+        }
+      }
+    }
+    if ($err && isset($data['message'])) {
+      $message_type = $data['message_type'] ? $data['message_type'] : 'status';
+      drupal_set_message($data['message'], $message_type);
+    }
+  }
+}
+
+/**
+ * Verify that a function exists.
+ *
+ * @param $setting
+ *   An array with some or all of the following directives:
+ *    'message'      = message to display if the function does not exist.
+ *    'message_type' = message type (ie, 'error', 'status')
+ */
+function drupal_verify_install_function($settings = array()) {
+  foreach ($settings as $function => $data) {
+    if (!function_exists($function)) {
+      $message_type = $data['message_type'] ? $data['message_type'] : 'status';
+      drupal_set_message($data['message'], $message_type);
+    }
+  }
+}
+
+?>
--- includes/install.apache.inc.orig	2006-02-20 08:42:45.000000000 -0500
+++ includes/install.apache.inc	2006-02-20 09:31:15.000000000 -0500
@@ -0,0 +1,71 @@
+<?php
+
+// Apache specific install functions
+
+/**
+ * Verify the current Apache installation.
+ *
+ * @param $settings
+ *  An array containing Apache requirements.  Supported arguments:
+ *   'version':  the required version of Apache
+ */
+function drupal_verify_install_apache($settings = array()) {
+  if (!_using_apache()) {
+    // don't perform Apache validations -- we're not using Apache
+    return;
+  }
+  foreach ($settings as $setting => $data) {
+    switch ($setting) {
+      case 'version':
+        _drupal_verify_version_apache($data);
+        break;
+      case 'module':
+        _drupal_verify_modules_apache($data);
+        break;
+    }
+  }
+}
+
+/**
+ * Check if Apache is currently being used to serve Drupal pages.
+ *
+ * @return
+ *  0 = not Apache, 1 = Apache
+ */
+function _using_apache() {
+  return preg_match('/apache/i', $_SERVER['SERVER_SOFTWARE']);
+}
+
+/**
+ * Verify that the version of Apache that is currently being used meets our
+ * minimum requirements.
+ *
+ * @param $version
+ *  An array containing version information and a message if the installed
+ *  version of Apache doesn't meet the minimum requirements.
+ *   Recognized options:
+ *    - 'required_version':  the required version of Apache
+ *    - 'message': message to display if insufficient version of Apache
+ *    - 'message_type': 'error' if critical, 'status' if warning
+ */
+function _drupal_verify_version_apache($version = array()) {
+  preg_match('!Apache/(.*) !', apache_get_version(), $v);
+  $installed_version = $v[1];
+  if (version_compare($installed_version, $version['required_version'], '<')) {
+    $message_type = $data['message_type'] ? $version['message_type'] : 'status';
+    drupal_set_message(strtr($version['message'], array('%required_version' => $version['required_version'], '%installed_version' => $installed_version)), $message_type);
+  }
+}
+
+/**
+ *
+ */
+function _drupal_verify_modules_apache($modules = array()) {
+  foreach ($modules as $module => $data) {
+    if (!in_array($module, apache_get_modules())) {
+      $message_type = $data['message_type'] ? $data['message_type'] : 'status';
+      drupal_set_message($data['message'], $message_type);
+    }
+  }
+}
+?>
--- includes/install.mysql.inc.orig	2006-02-20 08:42:42.000000000 -0500
+++ includes/install.mysql.inc	2006-02-20 08:53:42.000000000 -0500
@@ -0,0 +1,61 @@
+<?php
+
+// MySQL specific install functions
+
+/**
+ * Verify the current MySQL installation.
+ *
+ * @param $settings
+ *  An array containing MySQL requirements.  Supported arguments:
+ *   'version':  the required version of MySQL
+ */
+function drupal_verify_install_mysql($settings = array()) {
+  foreach ($settings as $setting => $data) {
+    switch ($setting) {
+      case 'version':
+        drupal_verify_version_mysql($data);
+      break;
+    }
+  }
+}
+
+/**
+ * Check if MySQL is currently being used.
+ *
+ * @return
+ *  0 = not MySQL, 1 = MySQL
+ */
+function _using_mysql() {
+  global $db_type;
+
+  if ($db_type == 'mysql') {
+    return 1;
+  }
+  else {
+    return 0;
+  }
+}
+
+/**
+ * Retrieve the version of MySQL that is currently being used.
+ *
+ * @param $version
+ *  An array containing version information and a message if the installed
+ *  version of MySQL doesn't meet the minimum requirements.
+ *   Recognized options:
+ *    - 'required_version': the required version of MySQL
+ *    - 'message': message to display if insufficient version of MySQL
+ *    - 'message_type': 'error' if critical, 'status' if warning
+ */
+function drupal_verify_version_mysql($version = array()) {
+  global $active_db;
+
+  if (!isset($active_db)) {
+    drupal_set_message('No connection to MySQL database, unable to verify MySQL version.', 'error');
+  }
+  elseif (version_compare(mysql_get_server_info($active_db), $version['required_version'], '<')) {
+    drupal_set_message(strtr($version['message'], array('%required_version' => $version['required_version'], '%installed_version' => mysql_get_server_info($active_db))), $version['message_type']);
+  }
+}
+
+?>
--- includes/theme.inc.orig	2006-02-19 20:37:04.000000000 -0500
+++ includes/theme.inc	2006-02-20 08:45:27.000000000 -0500
@@ -450,17 +450,63 @@
   return $output;
 }
 
+function theme_install_page($content) {
+  drupal_set_header('Content-Type: text/html; charset=utf-8');
+  theme('add_style', 'misc/maintenance.css');
+  drupal_set_html_head('<link rel="shortcut icon" href="'. base_path() .'misc/favicon.ico" type="image/x-icon" />');
+  $output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
+  $output .= '<html xmlns="http://www.w3.org/1999/xhtml">';
+  $output .= '<head>';
+  $output .= ' <title>'. drupal_get_title() .'</title>';
+  $output .= drupal_get_html_head();
+  $output .= theme_get_styles();
+  $output .= '</head>';
+  $output .= '<body>';
+  $output .= '<h1>' . drupal_get_title() . '</h1>';
+
+  $messages = drupal_set_message();
+  if (isset($messages['error'])) {
+    $output .= '<h3>The following errors must be resolved before you can continue the installation process:</h3>';
+    $output .= theme('status_messages', 'error');
+  }
+
+  $output .= "\n<!-- begin content -->\n";
+  $output .= $content;
+  $output .= "\n<!-- end content -->\n";
+
+  if (isset($messages['status'])) {
+    $output .= '<h4>The following installation warnings should be carefully reviewed, but in most cases may be safely ignored:</h4>';
+    $output .= theme('status_messages', 'status');
+  }
+
+  $output .= '</body></html>';
+
+  return $output;
+}
+
 /**
  * Returns themed set of status and/or error messages.  The messages are grouped
  * by type.
  *
+ * @param $display
+ *   Optional string if wish to display only 'error' or 'status' messages.
+ *
  * @return
  *   A string containing the messages.
  */
-function theme_status_messages() {
-  if ($data = drupal_get_messages()) {
+function theme_status_messages($display = NULL) {
+  static $data;
+
+  if (!$data) {
+    $data = drupal_get_messages();
+  }
+
+  if ($data) {
     $output = '';
     foreach ($data as $type => $messages) {
+      if ($display && $display != $type) {
+        continue;
+      }
       $output .= "<div class=\"messages $type\">\n";
       if (count($messages) > 1) {
         $output .= " <ul>\n";
@@ -473,6 +519,7 @@
         $output .= $messages[0];
       }
       $output .= "</div>\n";
+      unset($data["$type"]);
     }
 
     return $output;
--- modules/system.install.orig	2006-02-20 09:48:57.000000000 -0500
+++ modules/system.install	2006-02-20 09:41:53.000000000 -0500
@@ -0,0 +1,136 @@
+<?php
+
+/**
+ * The install _requirements_bootstrap hook is called before any installation
+ * begins.  This is a special hook for the system module as it is used to
+ * install the Drupal core.  Non-core modules and profiles will just use the 
+ * _pre and _post install hooks.
+ * Profiles can use the _bootstrap hook.
+ */
+function system_requirements_bootstrap() {
+  $settings = array();
+
+  // verify version of PHP
+  $settings['php']['version'] = array(
+    'required_version' => DRUPAL_MINIMUM_PHP,
+    'message'        => 'Drupal requires PHP version %required_version or greater.  You are using PHP version %installed_version so Drupal will not work properly on this installation.',
+    'message_type'   => 'error'
+  );
+
+  // verify safe_mode
+  $settings['php']['safe_mode'] = array(
+    'required_value' => 0,
+    'message'        => 'PHP safe_mode is currently enabled.  You must disable safe_mode for Drupal to properly function.',
+    'message_type'   => 'error'
+  );
+
+  // verify register_globals
+  $settings['php']['register_globals'] = array(
+    'required_value' => 0,
+    'message'        => 'PHP register_globals is currently enabled.  As of Drupal 4.2.0 it is advised that you disable register_globals.'
+  );
+
+  // verify PHP memory limits
+  if (function_exists(memory_get_usage)) {
+    // memory_get_usage() will only be defined if PHP is compiled with 
+    // the --enable-memory-limit configuration option.
+    $settings['php']['memory_limit'] = array(
+      'required_value' => DRUPAL_MINIMUM_MEMORY,
+      'operator'       => '>=',
+      'message'        => 'Your PHP installation limits Drupal to using only %current_value of RAM.  It is suggested that you modify the memory_limit directive to allow at least %required_value of RAM.',
+      'shorthand'      => TRUE
+    );
+  }
+
+  $settings['file']['./cron.php'] = array(
+      'type'           => 'file',
+      'mask'           => FILE_EXIST|FILE_READABLE|FILE_NOT_WRITEABLE,
+      'message'        => 'The cron.php file provides automation for Drupal functionality.  Most installations will want this file properly installed.  The file should be readable, and should not be writeable (as that would be a security risk).',
+      'message_type'   => 'error'
+  );
+
+  $settings['file']['./index.php'] = array(
+      'type'           => 'file',
+      'mask'           => FILE_EXIST|FILE_READABLE|FILE_NOT_WRITEABLE,
+      'required'       => TRUE,
+      'message'        => 'The index.php file is Drupal\'s main interface with the world.  This file must be readable, and must not be writeable (as that would be a security risk).',
+      'message_type'   => 'error'
+  );
+
+  $settings['file']['./xmlrpc.php'] = array(
+      'type'           => 'file',
+      'mask'           => FILE_EXIST|FILE_READABLE|FILE_NOT_WRITEABLE,
+      'required'       => TRUE
+  );
+
+  $settings['file']['./sites/default/settings.php'] = array(
+      'type'           => 'file',
+      'mask'           => FILE_EXIST|FILE_READABLE|FILE_WRITEABLE,
+      'required'       => TRUE,
+      'message'        => 'The Drupal installer requires write permissions to settings.php during the installation process.',
+      'message_type'   => 'error'
+  );
+
+  $settings['file']['./files'] = array(
+      'type'           => 'directory',
+      'mask'           => FILE_EXIST|FILE_READABLE|FILE_WRITEABLE,
+      'required'       => FALSE,
+      'message'        => 'The "files" subdirectory can be created in your installation directory to store files such as custom logos, user avatars, and other media associated with your new site.  The sub-directory requires "read and write" permission by the Drupal server process if you wish to provide this functionality.',
+  );
+
+  // if using Apache to serve pages
+  $settings['apache']['version'] = array(
+    'required_version' => DRUPAL_MINIMUM_APACHE,
+    'message'          => 'Drupal requires Apache version %required_version or greater.  You are using Apache version %installed_version so Drupal will not work properly on this installation.',
+    'message_type'     => 'error'
+  );
+
+  $settings['apache']['module']['mod_rewrite'] = array(
+    'message' => 'Apache\'s mod_rewrite is not enabled.  You will need to enable mod_rewrite if you wish to use Drupal\'s Clean URL functionality.'
+  );
+
+  $settings['function']['gzencode4'] = array(
+    'message' => 'For improved Drupal performance and reduced bandwidth consumption you can enable the PHP zlib extension.  If enabled, Drupal will compress cached pages and serve these pre-compressed pages to web browsers that support gzip.'
+  );
+
+  return $settings;
+}
+
+/**
+ * The install _requirements_pre hook is called after we have a established a
+ * connection to the database.  This hook will be called in non-core modules
+ * after Drupal core has been successfully installed.
+ */
+function system_requirements_pre() {
+  $settings = array();
+
+  $settings['mysql']['version'] = array(
+    'required_version' => DRUPAL_MINIMUM_MYSQL,
+    'message'          => 'Drupal requires MySQL version %required_version or greater.  You are using MySQL version %installed_version so Drupal will not work properly on this installation.',
+    'message_type'     => 'error'
+  );
+  $settings['pgsql']['version'] = array(
+    'required_version' => DRUPAL_MINIMUM_PGSQL,
+    'message'          => 'Drupal requires PostgreSQL version %required_version or greater.  You are using PostgreSQL version %installed_version so Drupal will not work properly on this installation.',
+    'message_type'     => 'error'
+  );
+
+  return $settings;
+}
+
+/**
+ * Install _requirements_post hook is called after the installation process
+ * is complete.
+ */
+function system_requirements_post() {
+  $settings['file']['./sites/default/settings.php'] = array(
+      'type'           => 'file',
+      'mask'           => FILE_EXIST|FILE_READABLE|FILE_NOT_WRITEABLE,
+      'required'       => TRUE,
+      'message'        => 'Now that the installation of Drupal is complete, you should remove write permissions to settings.php.',
+      'message_type'   => 'error'
+  );
+
+}
+
+?>
