? modules/system/.system.api.php.swp
Index: modules/aggregator/aggregator.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.install,v
retrieving revision 1.31
diff -u -p -r1.31 aggregator.install
--- modules/aggregator/aggregator.install	22 Aug 2010 13:55:53 -0000	1.31
+++ modules/aggregator/aggregator.install	5 Oct 2010 04:42:54 -0000
@@ -7,20 +7,6 @@
  */
 
 /**
- * Implements hook_uninstall().
- */
-function aggregator_uninstall() {
-  variable_del('aggregator_allowed_html_tags');
-  variable_del('aggregator_summary_items');
-  variable_del('aggregator_clear');
-  variable_del('aggregator_category_selector');
-  variable_del('aggregator_fetcher');
-  variable_del('aggregator_parser');
-  variable_del('aggregator_processors');
-  variable_del('aggregator_teaser_length');
-}
-
-/**
  * Implements hook_schema().
  */
 function aggregator_schema() {
@@ -281,6 +267,20 @@ function aggregator_schema() {
 }
 
 /**
+ * Implements hook_uninstall().
+ */
+function aggregator_uninstall() {
+  variable_del('aggregator_allowed_html_tags');
+  variable_del('aggregator_summary_items');
+  variable_del('aggregator_clear');
+  variable_del('aggregator_category_selector');
+  variable_del('aggregator_fetcher');
+  variable_del('aggregator_parser');
+  variable_del('aggregator_processors');
+  variable_del('aggregator_teaser_length');
+}
+
+/**
  * Add hash column to aggregator_feed table.
  */
 function aggregator_update_7000() {
Index: modules/book/book.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.install,v
retrieving revision 1.36
diff -u -p -r1.36 book.install
--- modules/book/book.install	23 Jun 2010 19:05:15 -0000	1.36
+++ modules/book/book.install	5 Oct 2010 04:42:54 -0000
@@ -7,47 +7,6 @@
  */
 
 /**
- * Implements hook_install().
- */
-function book_install() {
-  // Add the node type.
-  _book_install_type_create();
-}
-
-/**
- * Implements hook_uninstall().
- */
-function book_uninstall() {
-  // Delete menu links.
-  db_delete('menu_links')
-    ->condition('module', 'book')
-    ->execute();
-  menu_cache_clear_all();
-}
-
-function _book_install_type_create() {
-  // Create an additional node type.
-  $book_node_type = array(
-    'type' => 'book',
-    'name' => t('Book page'),
-    'base' => 'node_content',
-    'description' => t('<em>Books</em> have a built-in hierarchical navigation. Use for handbooks or tutorials.'),
-    'custom' => 1,
-    'modified' => 1,
-    'locked' => 0,
-  );
-
-  $book_node_type = node_type_set_defaults($book_node_type);
-  node_type_save($book_node_type);
-  node_add_body_field($book_node_type);
-  // Default to not promoted.
-  variable_set('node_options_book', array('status'));
-  // Use this default type for adding content to books.
-  variable_set('book_allowed_types', array('book'));
-  variable_set('book_child_type', 'book');
-}
-
-/**
  * Implements hook_schema().
  */
 function book_schema() {
@@ -87,3 +46,44 @@ function book_schema() {
 
   return $schema;
 }
+
+/**
+ * Implements hook_install().
+ */
+function book_install() {
+  // Add the node type.
+  _book_install_type_create();
+}
+
+/**
+ * Implements hook_uninstall().
+ */
+function book_uninstall() {
+  // Delete menu links.
+  db_delete('menu_links')
+    ->condition('module', 'book')
+    ->execute();
+  menu_cache_clear_all();
+}
+
+function _book_install_type_create() {
+  // Create an additional node type.
+  $book_node_type = array(
+    'type' => 'book',
+    'name' => t('Book page'),
+    'base' => 'node_content',
+    'description' => t('<em>Books</em> have a built-in hierarchical navigation. Use for handbooks or tutorials.'),
+    'custom' => 1,
+    'modified' => 1,
+    'locked' => 0,
+  );
+
+  $book_node_type = node_type_set_defaults($book_node_type);
+  node_type_save($book_node_type);
+  node_add_body_field($book_node_type);
+  // Default to not promoted.
+  variable_set('node_options_book', array('status'));
+  // Use this default type for adding content to books.
+  variable_set('book_allowed_types', array('book'));
+  variable_set('book_child_type', 'book');
+}
Index: modules/comment/comment.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.install,v
retrieving revision 1.73
diff -u -p -r1.73 comment.install
--- modules/comment/comment.install	28 Sep 2010 03:30:37 -0000	1.73
+++ modules/comment/comment.install	5 Oct 2010 04:42:54 -0000
@@ -7,6 +7,186 @@
  */
 
 /**
+ * Implements hook_schema().
+ */
+function comment_schema() {
+  $schema['comment'] = array(
+    'description' => 'Stores comments and associated data.',
+    'fields' => array(
+      'cid' => array(
+        'type' => 'serial',
+        'not null' => TRUE,
+        'description' => 'Primary Key: Unique comment ID.',
+      ),
+      'pid' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The {comment}.cid to which this comment is a reply. If set to 0, this comment is not a reply to an existing comment.',
+      ),
+      'nid' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The {node}.nid to which this comment is a reply.',
+      ),
+      'uid' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The {users}.uid who authored the comment. If set to 0, this comment was created by an anonymous user.',
+      ),
+      'subject' => array(
+        'type' => 'varchar',
+        'length' => 64,
+        'not null' => TRUE,
+        'default' => '',
+        'description' => 'The comment title.',
+      ),
+      'hostname' => array(
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => TRUE,
+        'default' => '',
+        'description' => "The author's host name.",
+      ),
+      'created' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The time that the comment was created, as a Unix timestamp.',
+      ),
+      'changed' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The time that the comment was last edited, as a Unix timestamp.',
+      ),
+      'status' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 1,
+        'size' => 'tiny',
+        'description' => 'The published status of a comment. (0 = Not Published, 1 = Published)',
+      ),
+      'thread' => array(
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'description' => "The vancode representation of the comment's place in a thread.",
+      ),
+      'name' => array(
+        'type' => 'varchar',
+        'length' => 60,
+        'not null' => FALSE,
+        'description' => "The comment author's name. Uses {users}.name if the user is logged in, otherwise uses the value typed into the comment form.",
+      ),
+      'mail' => array(
+        'type' => 'varchar',
+        'length' => 64,
+        'not null' => FALSE,
+        'description' => "The comment author's e-mail address from the comment form, if user is anonymous, and the 'Anonymous users may/must leave their contact information' setting is turned on.",
+      ),
+      'homepage' => array(
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => FALSE,
+        'description' => "The comment author's home page address from the comment form, if user is anonymous, and the 'Anonymous users may/must leave their contact information' setting is turned on.",
+      ),
+      'language' => array(
+        'description' => 'The {languages}.language of this comment.',
+        'type' => 'varchar',
+        'length' => 12,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+    ),
+    'indexes' => array(
+      'comment_status_pid' => array('pid', 'status'),
+      'comment_num_new' => array('nid', 'status', 'created', 'cid', 'thread'),
+      'comment_uid' => array('uid'),
+      'comment_nid_language' => array('nid', 'language'),
+    ),
+    'primary key' => array('cid'),
+    'foreign keys' => array(
+      'comment_node' => array(
+        'table' => 'node',
+        'columns' => array('nid' => 'nid'),
+      ),
+      'comment_author' => array(
+        'table' => 'users',
+        'columns' => array('uid' => 'uid'),
+      ),
+    ),
+  );
+
+  $schema['node_comment_statistics'] = array(
+    'description' => 'Maintains statistics of node and comments posts to show "new" and "updated" flags.',
+    'fields' => array(
+      'nid' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The {node}.nid for which the statistics are compiled.',
+      ),
+      'cid' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The {comment}.cid of the last comment.',
+      ),
+      'last_comment_timestamp' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The Unix timestamp of the last comment that was posted within this node, from {comment}.timestamp.',
+      ),
+      'last_comment_name' => array(
+        'type' => 'varchar',
+        'length' => 60,
+        'not null' => FALSE,
+        'description' => 'The name of the latest author to post a comment on this node, from {comment}.name.',
+      ),
+      'last_comment_uid' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The user ID of the latest author to post a comment on this node, from {comment}.uid.',
+      ),
+      'comment_count' => array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The total number of comments on this node.',
+      ),
+    ),
+    'primary key' => array('nid'),
+    'indexes' => array(
+      'node_comment_timestamp' => array('last_comment_timestamp'),
+      'comment_count' => array('comment_count'),
+      'last_comment_uid' => array('last_comment_uid'),
+    ),
+    'foreign keys' => array(
+      'statistics_node' => array(
+        'table' => 'node',
+        'columns' => array('nid' => 'nid'),
+      ),
+      'last_comment_author' => array(
+        'table' => 'users',
+        'columns' => array(
+          'last_comment_uid' => 'uid',
+        ),
+      ),
+    ),
+  );
+
+  return $schema;
+}
+
+/**
  * Implements hook_install().
  */
 function comment_install() {
@@ -36,6 +216,25 @@ function comment_install() {
 }
 
 /**
+ * Implements hook_enable().
+ */
+function comment_enable() {
+  // Insert records into the node_comment_statistics for nodes that are missing.
+  $query = db_select('node', 'n');
+  $query->leftJoin('node_comment_statistics', 'ncs', 'ncs.nid = n.nid');
+  $query->addField('n', 'created', 'last_comment_timestamp');
+  $query->addField('n', 'uid', 'last_comment_uid');
+  $query->addField('n', 'nid');
+  $query->addExpression('0', 'comment_count');
+  $query->addExpression('NULL', 'last_comment_name');
+  $query->isNull('ncs.comment_count');
+
+  db_insert('node_comment_statistics')
+    ->from($query)
+    ->execute();
+}
+
+/**
  * Implements hook_uninstall().
  */
 function comment_uninstall() {
@@ -59,25 +258,6 @@ function comment_uninstall() {
 }
 
 /**
- * Implements hook_enable().
- */
-function comment_enable() {
-  // Insert records into the node_comment_statistics for nodes that are missing.
-  $query = db_select('node', 'n');
-  $query->leftJoin('node_comment_statistics', 'ncs', 'ncs.nid = n.nid');
-  $query->addField('n', 'created', 'last_comment_timestamp');
-  $query->addField('n', 'uid', 'last_comment_uid');
-  $query->addField('n', 'nid');
-  $query->addExpression('0', 'comment_count');
-  $query->addExpression('NULL', 'last_comment_name');
-  $query->isNull('ncs.comment_count');
-
-  db_insert('node_comment_statistics')
-    ->from($query)
-    ->execute();
-}
-
-/**
  * Implements hook_update_dependencies().
  */
 function comment_update_dependencies() {
@@ -340,183 +520,3 @@ function comment_update_7006(&$sandbox) 
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */
-
-/**
- * Implements hook_schema().
- */
-function comment_schema() {
-  $schema['comment'] = array(
-    'description' => 'Stores comments and associated data.',
-    'fields' => array(
-      'cid' => array(
-        'type' => 'serial',
-        'not null' => TRUE,
-        'description' => 'Primary Key: Unique comment ID.',
-      ),
-      'pid' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The {comment}.cid to which this comment is a reply. If set to 0, this comment is not a reply to an existing comment.',
-      ),
-      'nid' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The {node}.nid to which this comment is a reply.',
-      ),
-      'uid' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The {users}.uid who authored the comment. If set to 0, this comment was created by an anonymous user.',
-      ),
-      'subject' => array(
-        'type' => 'varchar',
-        'length' => 64,
-        'not null' => TRUE,
-        'default' => '',
-        'description' => 'The comment title.',
-      ),
-      'hostname' => array(
-        'type' => 'varchar',
-        'length' => 128,
-        'not null' => TRUE,
-        'default' => '',
-        'description' => "The author's host name.",
-      ),
-      'created' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The time that the comment was created, as a Unix timestamp.',
-      ),
-      'changed' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The time that the comment was last edited, as a Unix timestamp.',
-      ),
-      'status' => array(
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 1,
-        'size' => 'tiny',
-        'description' => 'The published status of a comment. (0 = Not Published, 1 = Published)',
-      ),
-      'thread' => array(
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'description' => "The vancode representation of the comment's place in a thread.",
-      ),
-      'name' => array(
-        'type' => 'varchar',
-        'length' => 60,
-        'not null' => FALSE,
-        'description' => "The comment author's name. Uses {users}.name if the user is logged in, otherwise uses the value typed into the comment form.",
-      ),
-      'mail' => array(
-        'type' => 'varchar',
-        'length' => 64,
-        'not null' => FALSE,
-        'description' => "The comment author's e-mail address from the comment form, if user is anonymous, and the 'Anonymous users may/must leave their contact information' setting is turned on.",
-      ),
-      'homepage' => array(
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => FALSE,
-        'description' => "The comment author's home page address from the comment form, if user is anonymous, and the 'Anonymous users may/must leave their contact information' setting is turned on.",
-      ),
-      'language' => array(
-        'description' => 'The {languages}.language of this comment.',
-        'type' => 'varchar',
-        'length' => 12,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-    ),
-    'indexes' => array(
-      'comment_status_pid' => array('pid', 'status'),
-      'comment_num_new' => array('nid', 'status', 'created', 'cid', 'thread'),
-      'comment_uid' => array('uid'),
-      'comment_nid_language' => array('nid', 'language'),
-    ),
-    'primary key' => array('cid'),
-    'foreign keys' => array(
-      'comment_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
-      ),
-      'comment_author' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid'),
-      ),
-    ),
-  );
-
-  $schema['node_comment_statistics'] = array(
-    'description' => 'Maintains statistics of node and comments posts to show "new" and "updated" flags.',
-    'fields' => array(
-      'nid' => array(
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The {node}.nid for which the statistics are compiled.',
-      ),
-      'cid' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The {comment}.cid of the last comment.',
-      ),
-      'last_comment_timestamp' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The Unix timestamp of the last comment that was posted within this node, from {comment}.timestamp.',
-      ),
-      'last_comment_name' => array(
-        'type' => 'varchar',
-        'length' => 60,
-        'not null' => FALSE,
-        'description' => 'The name of the latest author to post a comment on this node, from {comment}.name.',
-      ),
-      'last_comment_uid' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The user ID of the latest author to post a comment on this node, from {comment}.uid.',
-      ),
-      'comment_count' => array(
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'The total number of comments on this node.',
-      ),
-    ),
-    'primary key' => array('nid'),
-    'indexes' => array(
-      'node_comment_timestamp' => array('last_comment_timestamp'),
-      'comment_count' => array('comment_count'),
-      'last_comment_uid' => array('last_comment_uid'),
-    ),
-    'foreign keys' => array(
-      'statistics_node' => array(
-        'table' => 'node',
-        'columns' => array('nid' => 'nid'),
-      ),
-      'last_comment_author' => array(
-        'table' => 'users',
-        'columns' => array(
-          'last_comment_uid' => 'uid',
-        ),
-      ),
-    ),
-  );
-
-  return $schema;
-}
Index: modules/field/tests/field_test.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/tests/field_test.install,v
retrieving revision 1.5
diff -u -p -r1.5 field_test.install
--- modules/field/tests/field_test.install	11 Sep 2010 06:03:11 -0000	1.5
+++ modules/field/tests/field_test.install	5 Oct 2010 04:42:54 -0000
@@ -7,17 +7,6 @@
  */
 
 /**
- * Implements hook_install().
- */
-function field_test_install() {
-  // hook_entity_info_alter() needs to be executed as last.
-  db_update('system')
-    ->fields(array('weight' => 1))
-    ->condition('name', 'field_test')
-    ->execute();
-}
-
-/**
  * Implements hook_schema().
  */
 function field_test_schema() {
@@ -149,3 +138,14 @@ function field_test_field_schema($field)
     );
   }
 }
+
+/**
+ * Implements hook_install().
+ */
+function field_test_install() {
+  // hook_entity_info_alter() needs to be executed as last.
+  db_update('system')
+    ->fields(array('weight' => 1))
+    ->condition('name', 'field_test')
+    ->execute();
+}
Index: modules/forum/forum.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.install,v
retrieving revision 1.51
diff -u -p -r1.51 forum.install
--- modules/forum/forum.install	1 Oct 2010 01:37:13 -0000	1.51
+++ modules/forum/forum.install	5 Oct 2010 04:42:54 -0000
@@ -7,118 +7,6 @@
  */
 
 /**
- * Implements hook_install().
- */
-function forum_install() {
-  // Set the weight of the forum.module to 1 so it is loaded after the taxonomy.module.
-  db_update('system')
-    ->fields(array('weight' => 1))
-    ->condition('name', 'forum')
-    ->execute();
-  // Forum topics are published by default, but do not have any other default
-  // options set (for example, they are not promoted to the front page).
-  variable_set('node_options_forum', array('status'));
-}
-
-/**
- * Implements hook_enable().
- */
-function forum_enable() {
-  // If we enable forum at the same time as taxonomy we need to call
-  // field_associate_fields() as otherwise the field won't be enabled until
-  // hook modules_enabled is called which takes place after hook_enable events.
-  field_associate_fields('taxonomy');
-  // Create the forum vocabulary if it does not exist.
-  $vocabulary = taxonomy_vocabulary_load(variable_get('forum_nav_vocabulary', 0));
-  if (!$vocabulary) {
-    $edit = array(
-      'name' => t('Forums'),
-      'machine_name' => 'forums',
-      'description' => t('Forum navigation vocabulary'),
-      'hierarchy' => 1,
-      'module' => 'forum',
-      'weight' => -10,
-    );
-    $vocabulary = (object) $edit;
-    taxonomy_vocabulary_save($vocabulary);
-    variable_set('forum_nav_vocabulary', $vocabulary->vid);
-  }
-
-  // Create the 'taxonomy_forums' field if it doesn't already exist.
-  if (!field_info_field('taxonomy_forums')) {
-    $field = array(
-      'field_name' => 'taxonomy_' . $vocabulary->machine_name,
-      'type' => 'taxonomy_term_reference',
-      'settings' => array(
-        'allowed_values' => array(
-          array(
-            'vocabulary' => $vocabulary->machine_name,
-            'parent' => 0,
-          ),
-        ),
-      ),
-    );
-    field_create_field($field);
-
-    variable_set('forum_nav_vocabulary', $vocabulary->vid);
-
-    // Create a default forum so forum posts can be created.
-    $edit = array(
-      'name' => t('General discussion'),
-      'description' => '',
-      'parent' => array(0),
-      'vid' => $vocabulary->vid,
-    );
-    $term = (object) $edit;
-    taxonomy_term_save($term);
-  }
-
-  // Create the instance on the bundle.
-  $instance = array(
-    'field_name' => 'taxonomy_' . $vocabulary->machine_name,
-    'entity_type' => 'node',
-    'label' => $vocabulary->name,
-    'bundle' => 'forum',
-    'required' => TRUE,
-    'widget' => array(
-      'type' => 'options_select',
-    ),
-    'display' => array(
-      'default' => array(
-        'type' => 'taxonomy_term_reference_link',
-        'weight' => 10,
-      ),
-      'teaser' => array(
-        'type' => 'taxonomy_term_reference_link',
-        'weight' => 10,
-      ),
-    ),
-  );
-  field_create_instance($instance);
-
-  // Ensure the forum node type is available.
-  node_types_rebuild();
-  $types = node_type_get_types();
-  node_add_body_field($types['forum']);
-}
-
-/**
- * Implements hook_uninstall().
- */
-function forum_uninstall() {
-  // Load the dependent Taxonomy module, in case it has been disabled.
-  drupal_load('module', 'taxonomy');
-
-  variable_del('forum_containers');
-  variable_del('forum_hot_topic');
-  variable_del('forum_per_page');
-  variable_del('forum_order');
-  variable_del('forum_block_num_active');
-  variable_del('forum_block_num_new');
-  variable_del('node_options_forum');
-}
-
-/**
  * Implements hook_schema().
  */
 function forum_schema() {
@@ -237,6 +125,118 @@ function forum_schema() {
 }
 
 /**
+ * Implements hook_install().
+ */
+function forum_install() {
+  // Set the weight of the forum.module to 1 so it is loaded after the taxonomy.module.
+  db_update('system')
+    ->fields(array('weight' => 1))
+    ->condition('name', 'forum')
+    ->execute();
+  // Forum topics are published by default, but do not have any other default
+  // options set (for example, they are not promoted to the front page).
+  variable_set('node_options_forum', array('status'));
+}
+
+/**
+ * Implements hook_enable().
+ */
+function forum_enable() {
+  // If we enable forum at the same time as taxonomy we need to call
+  // field_associate_fields() as otherwise the field won't be enabled until
+  // hook modules_enabled is called which takes place after hook_enable events.
+  field_associate_fields('taxonomy');
+  // Create the forum vocabulary if it does not exist.
+  $vocabulary = taxonomy_vocabulary_load(variable_get('forum_nav_vocabulary', 0));
+  if (!$vocabulary) {
+    $edit = array(
+      'name' => t('Forums'),
+      'machine_name' => 'forums',
+      'description' => t('Forum navigation vocabulary'),
+      'hierarchy' => 1,
+      'module' => 'forum',
+      'weight' => -10,
+    );
+    $vocabulary = (object) $edit;
+    taxonomy_vocabulary_save($vocabulary);
+    variable_set('forum_nav_vocabulary', $vocabulary->vid);
+  }
+
+  // Create the 'taxonomy_forums' field if it doesn't already exist.
+  if (!field_info_field('taxonomy_forums')) {
+    $field = array(
+      'field_name' => 'taxonomy_' . $vocabulary->machine_name,
+      'type' => 'taxonomy_term_reference',
+      'settings' => array(
+        'allowed_values' => array(
+          array(
+            'vocabulary' => $vocabulary->machine_name,
+            'parent' => 0,
+          ),
+        ),
+      ),
+    );
+    field_create_field($field);
+
+    variable_set('forum_nav_vocabulary', $vocabulary->vid);
+
+    // Create a default forum so forum posts can be created.
+    $edit = array(
+      'name' => t('General discussion'),
+      'description' => '',
+      'parent' => array(0),
+      'vid' => $vocabulary->vid,
+    );
+    $term = (object) $edit;
+    taxonomy_term_save($term);
+  }
+
+  // Create the instance on the bundle.
+  $instance = array(
+    'field_name' => 'taxonomy_' . $vocabulary->machine_name,
+    'entity_type' => 'node',
+    'label' => $vocabulary->name,
+    'bundle' => 'forum',
+    'required' => TRUE,
+    'widget' => array(
+      'type' => 'options_select',
+    ),
+    'display' => array(
+      'default' => array(
+        'type' => 'taxonomy_term_reference_link',
+        'weight' => 10,
+      ),
+      'teaser' => array(
+        'type' => 'taxonomy_term_reference_link',
+        'weight' => 10,
+      ),
+    ),
+  );
+  field_create_instance($instance);
+
+  // Ensure the forum node type is available.
+  node_types_rebuild();
+  $types = node_type_get_types();
+  node_add_body_field($types['forum']);
+}
+
+/**
+ * Implements hook_uninstall().
+ */
+function forum_uninstall() {
+  // Load the dependent Taxonomy module, in case it has been disabled.
+  drupal_load('module', 'taxonomy');
+
+  variable_del('forum_containers');
+  variable_del('forum_hot_topic');
+  variable_del('forum_per_page');
+  variable_del('forum_order');
+  variable_del('forum_block_num_active');
+  variable_del('forum_block_num_new');
+  variable_del('node_options_forum');
+}
+
+/**
  * Add new index to forum table.
  */
 function forum_update_7000() {
Index: modules/image/image.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.install,v
retrieving revision 1.13
diff -u -p -r1.13 image.install
--- modules/image/image.install	4 Sep 2010 15:40:51 -0000	1.13
+++ modules/image/image.install	5 Oct 2010 04:42:54 -0000
@@ -7,23 +7,6 @@
  */
 
 /**
- * Implements hook_install().
- */
-function image_install() {
-  // Create the styles directory and ensure it's writable.
-  $directory = file_default_scheme() . '://styles';
-  file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
-}
-
-/**
- * Implements hook_uninstall().
- */
-function image_uninstall() {
-  // Remove the styles directory and generated images.
-  file_unmanaged_delete_recursive(file_default_scheme() . '://styles');
-}
-
-/**
  * Implements hook_schema().
  */
 function image_schema() {
@@ -139,6 +122,61 @@ function image_field_schema($field) {
 }
 
 /**
+ * Implements hook_requirements() to check the PHP GD Library.
+ *
+ * @param $phase
+ */
+function image_requirements($phase) {
+  $requirements = array();
+
+  if ($phase == 'runtime') {
+    // Check for the PHP GD library.
+    if (function_exists('imagegd2')) {
+      $info = gd_info();
+      $requirements['image_gd'] = array(
+        'value' => $info['GD Version'],
+      );
+
+      // Check for filter and rotate support.
+      if (function_exists('imagefilter') && function_exists('imagerotate')) {
+        $requirements['image_gd']['severity'] = REQUIREMENT_OK;
+      }
+      else {
+        $requirements['image_gd']['severity'] = REQUIREMENT_ERROR;
+        $requirements['image_gd']['description'] = t('The GD Library for PHP is enabled, but was compiled without support for functions used by the rotate and desaturate effects. It was probably compiled using the official GD libraries from http://www.libgd.org instead of the GD library bundled with PHP. You should recompile PHP --with-gd using the bundled GD library. See <a href="http://www.php.net/manual/book.image.php">the PHP manual</a>.');
+      }
+    }
+    else {
+      $requirements['image_gd'] = array(
+        'value' => t('Not installed'),
+        'severity' => REQUIREMENT_ERROR,
+        'description' => t('The GD library for PHP is missing or outdated. Check the <a href="@url">PHP image documentation</a> for information on how to correct this.', array('@url' => 'http://www.php.net/manual/book.image.php')),
+      );
+    }
+    $requirements['image_gd']['title'] = t('GD library rotate and desaturate effects');
+  }
+
+  return $requirements;
+}
+
+/**
+ * Implements hook_install().
+ */
+function image_install() {
+  // Create the styles directory and ensure it's writable.
+  $directory = file_default_scheme() . '://styles';
+  file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
+}
+
+/**
+ * Implements hook_uninstall().
+ */
+function image_uninstall() {
+  // Remove the styles directory and generated images.
+  file_unmanaged_delete_recursive(file_default_scheme() . '://styles');
+}
+
+/**
  * Install the schema for users upgrading from the contributed module.
  */
 function image_update_7000() {
@@ -225,41 +263,3 @@ function image_update_7000() {
     db_create_table('image_effect', $schema['image_effects']);
   }
 }
-
-/**
- * Implements hook_requirements() to check the PHP GD Library.
- *
- * @param $phase
- */
-function image_requirements($phase) {
-  $requirements = array();
-
-  if ($phase == 'runtime') {
-    // Check for the PHP GD library.
-    if (function_exists('imagegd2')) {
-      $info = gd_info();
-      $requirements['image_gd'] = array(
-        'value' => $info['GD Version'],
-      );
-
-      // Check for filter and rotate support.
-      if (function_exists('imagefilter') && function_exists('imagerotate')) {
-        $requirements['image_gd']['severity'] = REQUIREMENT_OK;
-      }
-      else {
-        $requirements['image_gd']['severity'] = REQUIREMENT_ERROR;
-        $requirements['image_gd']['description'] = t('The GD Library for PHP is enabled, but was compiled without support for functions used by the rotate and desaturate effects. It was probably compiled using the official GD libraries from http://www.libgd.org instead of the GD library bundled with PHP. You should recompile PHP --with-gd using the bundled GD library. See <a href="http://www.php.net/manual/book.image.php">the PHP manual</a>.');
-      }
-    }
-    else {
-      $requirements['image_gd'] = array(
-        'value' => t('Not installed'),
-        'severity' => REQUIREMENT_ERROR,
-        'description' => t('The GD library for PHP is missing or outdated. Check the <a href="@url">PHP image documentation</a> for information on how to correct this.', array('@url' => 'http://www.php.net/manual/book.image.php')),
-      );
-    }
-    $requirements['image_gd']['title'] = t('GD library rotate and desaturate effects');
-  }
-
-  return $requirements;
-}
Index: modules/locale/locale.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.install,v
retrieving revision 1.67
diff -u -p -r1.67 locale.install
--- modules/locale/locale.install	25 Sep 2010 18:10:53 -0000	1.67
+++ modules/locale/locale.install	5 Oct 2010 04:42:54 -0000
@@ -7,157 +7,6 @@
  */
 
 /**
- * Implements hook_install().
- */
-function locale_install() {
-  // locales_source.source and locales_target.target are not used as binary
-  // fields; non-MySQL database servers need to ensure the field type is text
-  // and that LIKE produces a case-sensitive comparison.
-
-  db_insert('languages')
-    ->fields(array(
-      'language' => 'en',
-      'name' => 'English',
-      'native' => 'English',
-      'direction' => 0,
-      'enabled' => 1,
-      'weight' => 0,
-      'javascript' => '',
-    ))
-    ->execute();
-}
-
-/**
- * @defgroup updates-6.x-to-7.x Locale updates from 6.x to 7.x
- * @{
- */
-
-/**
- * Add context field index and allow longer location.
- */
-function locale_update_7000() {
-  db_drop_index('locales_source', 'source');
-  db_add_index('locales_source', 'source_context', array(array('source', 30), 'context'));
-  db_change_field('locales_source', 'location', 'location', array('type' => 'text', 'size' => 'big', 'not null' => FALSE));
-}
-
-/**
- * Upgrade language negotiation settings.
- */
-function locale_update_7001() {
-  require_once DRUPAL_ROOT . '/includes/language.inc';
-  require_once DRUPAL_ROOT . '/modules/locale/locale.module';
-
-  switch (variable_get('language_negotiation', 0)) {
-    // LANGUAGE_NEGOTIATION_NONE.
-    case 0:
-      $negotiation = array();
-      break;
-
-    // LANGUAGE_NEGOTIATION_PATH_DEFAULT.
-    case 1:
-      $negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL);
-      // In Drupal 6 path prefixes are shown for the default language only when
-      // language negotiation is set to LANGUAGE_NEGOTIATION_PATH, while in
-      // Drupal 7 path prefixes are always shown if not empty. Hence we need to
-      // ensure that the default language has an empty prefix to avoid breaking
-      // the site URLs with a prefix that previously was missing.
-      db_update('languages')
-        ->fields(array('prefix' => ''))
-        ->condition('language', language_default()->language)
-        ->execute();
-      break;
-
-    // LANGUAGE_NEGOTIATION_PATH.
-    case 2:
-      $negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL, LOCALE_LANGUAGE_NEGOTIATION_USER, LOCALE_LANGUAGE_NEGOTIATION_BROWSER);
-      break;
-
-    // LANGUAGE_NEGOTIATION_DOMAIN.
-    case 3:
-      variable_set('locale_language_negotiation_url_part', LOCALE_LANGUAGE_NEGOTIATION_URL_DOMAIN);
-      $negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL);
-      break;
-  }
-
-  // Save the new language negotiation options.
-  language_negotiation_set(LANGUAGE_TYPE_INTERFACE, array_flip($negotiation));
-  language_negotiation_set(LANGUAGE_TYPE_CONTENT, array(LOCALE_LANGUAGE_NEGOTIATION_INTERFACE => 0));
-  language_negotiation_set(LANGUAGE_TYPE_URL, array(LOCALE_LANGUAGE_NEGOTIATION_URL => 0));
-
-  // Save admininstration UI settings.
-  $type = LANGUAGE_TYPE_INTERFACE;
-  $provider_weights = array_flip(array_keys(locale_language_negotiation_info()));
-  variable_set("locale_language_providers_weight_$type", $provider_weights);
-
-  // Update language switcher block delta.
-  db_update('block')
-    ->fields(array('delta' => $type))
-    ->condition('module', 'locale')
-    ->condition('delta', 0)
-    ->execute();
-
-  // Unset the old language negotiation system variable.
-  variable_del('language_negotiation');
-
-  return array();
-}
-
-/**
- * @} End of "defgroup updates-6.x-to-7.x"
- */
-
-/**
- * Implements hook_uninstall().
- */
-function locale_uninstall() {
-  // Delete all JavaScript translation files.
-  $locale_js_directory = 'public://' . variable_get('locale_js_directory', 'languages');
-
-  if (is_dir($locale_js_directory)) {
-    $files = db_query('SELECT language, javascript FROM {languages}');
-    foreach ($files as $file) {
-      if (!empty($file->javascript)) {
-        file_unmanaged_delete($locale_js_directory . '/' . $file->language . '_' . $file->javascript . '.js');
-      }
-    }
-    // Delete the JavaScript translations directory if empty.
-    if (!file_scan_directory($locale_js_directory, '/.*/')) {
-      drupal_rmdir($locale_js_directory);
-    }
-  }
-
-  // Clear variables.
-  variable_del('language_default');
-  variable_del('language_count');
-  variable_del('language_types');
-  variable_del('locale_language_negotiation_url_part');
-  variable_del('locale_language_negotiation_session_param');
-  variable_del('language_content_type_default');
-  variable_del('language_content_type_negotiation');
-  variable_del('locale_cache_strings');
-  variable_del('locale_js_directory');
-  variable_del('javascript_parsed');
-  variable_del('locale_field_language_fallback');
-  variable_del('locale_cache_length');
-
-  foreach (language_types() as $type) {
-    variable_del("language_negotiation_$type");
-    variable_del("locale_language_providers_weight_$type");
-  }
-
-  foreach (node_type_get_types() as $type => $content_type) {
-    $setting = variable_del("language_content_type_$type");
-  }
-
-  // Switch back to English: with a $language->language value different from 'en'
-  // successive calls of t() might result in calling locale(), which in turn might
-  // try to query the unexisting {locales_source} and {locales_target} tables.
-  drupal_language_initialize();
-
-}
-
-/**
  * Implements hook_schema().
  */
 function locale_schema() {
@@ -344,3 +193,153 @@ function locale_schema() {
   return $schema;
 }
 
+/**
+ * Implements hook_install().
+ */
+function locale_install() {
+  // locales_source.source and locales_target.target are not used as binary
+  // fields; non-MySQL database servers need to ensure the field type is text
+  // and that LIKE produces a case-sensitive comparison.
+
+  db_insert('languages')
+    ->fields(array(
+      'language' => 'en',
+      'name' => 'English',
+      'native' => 'English',
+      'direction' => 0,
+      'enabled' => 1,
+      'weight' => 0,
+      'javascript' => '',
+    ))
+    ->execute();
+}
+
+/**
+ * Implements hook_uninstall().
+ */
+function locale_uninstall() {
+  // Delete all JavaScript translation files.
+  $locale_js_directory = 'public://' . variable_get('locale_js_directory', 'languages');
+
+  if (is_dir($locale_js_directory)) {
+    $files = db_query('SELECT language, javascript FROM {languages}');
+    foreach ($files as $file) {
+      if (!empty($file->javascript)) {
+        file_unmanaged_delete($locale_js_directory . '/' . $file->language . '_' . $file->javascript . '.js');
+      }
+    }
+    // Delete the JavaScript translations directory if empty.
+    if (!file_scan_directory($locale_js_directory, '/.*/')) {
+      drupal_rmdir($locale_js_directory);
+    }
+  }
+
+  // Clear variables.
+  variable_del('language_default');
+  variable_del('language_count');
+  variable_del('language_types');
+  variable_del('locale_language_negotiation_url_part');
+  variable_del('locale_language_negotiation_session_param');
+  variable_del('language_content_type_default');
+  variable_del('language_content_type_negotiation');
+  variable_del('locale_cache_strings');
+  variable_del('locale_js_directory');
+  variable_del('javascript_parsed');
+  variable_del('locale_field_language_fallback');
+  variable_del('locale_cache_length');
+
+  foreach (language_types() as $type) {
+    variable_del("language_negotiation_$type");
+    variable_del("locale_language_providers_weight_$type");
+  }
+
+  foreach (node_type_get_types() as $type => $content_type) {
+    $setting = variable_del("language_content_type_$type");
+  }
+
+  // Switch back to English: with a $language->language value different from 'en'
+  // successive calls of t() might result in calling locale(), which in turn might
+  // try to query the unexisting {locales_source} and {locales_target} tables.
+  drupal_language_initialize();
+
+}
+
+/**
+ * @defgroup updates-6.x-to-7.x Locale updates from 6.x to 7.x
+ * @{
+ */
+
+/**
+ * Add context field index and allow longer location.
+ */
+function locale_update_7000() {
+  db_drop_index('locales_source', 'source');
+  db_add_index('locales_source', 'source_context', array(array('source', 30), 'context'));
+  db_change_field('locales_source', 'location', 'location', array('type' => 'text', 'size' => 'big', 'not null' => FALSE));
+}
+
+/**
+ * Upgrade language negotiation settings.
+ */
+function locale_update_7001() {
+  require_once DRUPAL_ROOT . '/includes/language.inc';
+  require_once DRUPAL_ROOT . '/modules/locale/locale.module';
+
+  switch (variable_get('language_negotiation', 0)) {
+    // LANGUAGE_NEGOTIATION_NONE.
+    case 0:
+      $negotiation = array();
+      break;
+
+    // LANGUAGE_NEGOTIATION_PATH_DEFAULT.
+    case 1:
+      $negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL);
+      // In Drupal 6 path prefixes are shown for the default language only when
+      // language negotiation is set to LANGUAGE_NEGOTIATION_PATH, while in
+      // Drupal 7 path prefixes are always shown if not empty. Hence we need to
+      // ensure that the default language has an empty prefix to avoid breaking
+      // the site URLs with a prefix that previously was missing.
+      db_update('languages')
+        ->fields(array('prefix' => ''))
+        ->condition('language', language_default()->language)
+        ->execute();
+      break;
+
+    // LANGUAGE_NEGOTIATION_PATH.
+    case 2:
+      $negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL, LOCALE_LANGUAGE_NEGOTIATION_USER, LOCALE_LANGUAGE_NEGOTIATION_BROWSER);
+      break;
+
+    // LANGUAGE_NEGOTIATION_DOMAIN.
+    case 3:
+      variable_set('locale_language_negotiation_url_part', LOCALE_LANGUAGE_NEGOTIATION_URL_DOMAIN);
+      $negotiation = array(LOCALE_LANGUAGE_NEGOTIATION_URL);
+      break;
+  }
+
+  // Save the new language negotiation options.
+  language_negotiation_set(LANGUAGE_TYPE_INTERFACE, array_flip($negotiation));
+  language_negotiation_set(LANGUAGE_TYPE_CONTENT, array(LOCALE_LANGUAGE_NEGOTIATION_INTERFACE => 0));
+  language_negotiation_set(LANGUAGE_TYPE_URL, array(LOCALE_LANGUAGE_NEGOTIATION_URL => 0));
+
+  // Save admininstration UI settings.
+  $type = LANGUAGE_TYPE_INTERFACE;
+  $provider_weights = array_flip(array_keys(locale_language_negotiation_info()));
+  variable_set("locale_language_providers_weight_$type", $provider_weights);
+
+  // Update language switcher block delta.
+  db_update('block')
+    ->fields(array('delta' => $type))
+    ->condition('module', 'locale')
+    ->condition('delta', 0)
+    ->execute();
+
+  // Unset the old language negotiation system variable.
+  variable_del('language_negotiation');
+
+  return array();
+}
+
+/**
+ * @} End of "defgroup updates-6.x-to-7.x"
+ */
Index: modules/profile/profile.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.install,v
retrieving revision 1.26
diff -u -p -r1.26 profile.install
--- modules/profile/profile.install	22 Aug 2010 13:55:53 -0000	1.26
+++ modules/profile/profile.install	5 Oct 2010 04:42:54 -0000
@@ -7,13 +7,6 @@
  */
 
 /**
- * Implements hook_uninstall().
- */
-function profile_uninstall() {
-  variable_del('profile_block_author_fields');
-}
-
-/**
  * Implements hook_schema().
  */
 function profile_schema() {
@@ -153,6 +146,13 @@ function profile_schema() {
 }
 
 /**
+ * Implements hook_uninstall().
+ */
+function profile_uninstall() {
+  variable_del('profile_block_author_fields');
+}
+
+/**
  * Rename {profile_fields} table to {profile_field} and {profile_values} to {profile_value}.
  */
 function profile_update_7001() {
Index: modules/search/search.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.install,v
retrieving revision 1.29
diff -u -p -r1.29 search.install
--- modules/search/search.install	22 Aug 2010 13:55:53 -0000	1.29
+++ modules/search/search.install	5 Oct 2010 04:42:54 -0000
@@ -7,15 +7,6 @@
  */
 
 /**
- * Implements hook_uninstall().
- */
-function search_uninstall() {
-  variable_del('minimum_word_size');
-  variable_del('overlap_cjk');
-  variable_del('search_cron_limit');
-}
-
-/**
  * Implements hook_schema().
  */
 function search_schema() {
@@ -156,6 +147,15 @@ function search_schema() {
 }
 
 /**
+ * Implements hook_uninstall().
+ */
+function search_uninstall() {
+  variable_del('minimum_word_size');
+  variable_del('overlap_cjk');
+  variable_del('search_cron_limit');
+}
+
+/**
  * Replace unique keys in 'search_dataset' and 'search_index' by primary keys.
  */
 function search_update_7000() {
Index: modules/shortcut/shortcut.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/shortcut/shortcut.install,v
retrieving revision 1.6
diff -u -p -r1.6 shortcut.install
--- modules/shortcut/shortcut.install	22 Aug 2010 13:55:53 -0000	1.6
+++ modules/shortcut/shortcut.install	5 Oct 2010 04:42:54 -0000
@@ -7,39 +7,6 @@
  */
 
 /**
- * Implements hook_install().
- */
-function shortcut_install() {
-  $t = get_t();
-  // Create an initial default shortcut set.
-  $shortcut_set = new stdClass();
-  $shortcut_set->title = $t('Default');
-  $shortcut_set->links = array(
-    array(
-      'link_path' => 'node/add',
-      'link_title' => $t('Add content'),
-      'weight' => -20,
-    ),
-    array(
-      'link_path' => 'admin/content',
-      'link_title' => $t('Find content'),
-      'weight' => -19,
-    ),
-  );
-  shortcut_set_save($shortcut_set);
-}
-
-/**
- * Implements hook_uninstall().
- */
-function shortcut_uninstall() {
-  // Delete the menu links associated with each shortcut set.
-  foreach (shortcut_sets() as $shortcut_set) {
-    menu_delete_links($shortcut_set->set_name);
-  }
-}
-
-/**
  * Implements hook_schema().
  */
 function shortcut_schema() {
@@ -106,3 +73,36 @@ function shortcut_schema() {
 
   return $schema;
 }
+
+/**
+ * Implements hook_install().
+ */
+function shortcut_install() {
+  $t = get_t();
+  // Create an initial default shortcut set.
+  $shortcut_set = new stdClass();
+  $shortcut_set->title = $t('Default');
+  $shortcut_set->links = array(
+    array(
+      'link_path' => 'node/add',
+      'link_title' => $t('Add content'),
+      'weight' => -20,
+    ),
+    array(
+      'link_path' => 'admin/content',
+      'link_title' => $t('Find content'),
+      'weight' => -19,
+    ),
+  );
+  shortcut_set_save($shortcut_set);
+}
+
+/**
+ * Implements hook_uninstall().
+ */
+function shortcut_uninstall() {
+  // Delete the menu links associated with each shortcut set.
+  foreach (shortcut_sets() as $shortcut_set) {
+    menu_delete_links($shortcut_set->set_name);
+  }
+}
Index: modules/simpletest/simpletest.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.install,v
retrieving revision 1.37
diff -u -p -r1.37 simpletest.install
--- modules/simpletest/simpletest.install	1 Sep 2010 20:08:17 -0000	1.37
+++ modules/simpletest/simpletest.install	5 Oct 2010 04:42:54 -0000
@@ -6,81 +6,6 @@
  * Install, update and uninstall functions for the simpletest module.
  */
 
-/**
- * Implements hook_uninstall().
- */
-function simpletest_uninstall() {
-  simpletest_clean_environment();
-
-  // Remove settings variables.
-  variable_del('simpletest_httpauth_method');
-  variable_del('simpletest_httpauth_username');
-  variable_del('simpletest_httpauth_password');
-  variable_del('simpletest_clear_results');
-  variable_del('simpletest_verbose');
-
-  // Remove generated files.
-  $path = 'public://simpletest';
-  $files = file_scan_directory($path, '/.*/');
-  foreach ($files as $file) {
-    file_unmanaged_delete($file->uri);
-  }
-  drupal_rmdir($path);
-}
-
-/**
- * Check that the cURL extension exists for PHP.
- */
-function simpletest_requirements($phase) {
-  $requirements = array();
-  $t = get_t();
-
-  $has_curl = function_exists('curl_init');
-  $has_hash = function_exists('hash_hmac');
-  $has_domdocument = class_exists('DOMDocument');
-  $open_basedir = ini_get('open_basedir');
-
-  $requirements['curl'] = array(
-    'title' => $t('cURL'),
-    'value' => $has_curl ? $t('Enabled') : $t('Not found'),
-  );
-  if (!$has_curl) {
-    $requirements['curl']['severity'] = REQUIREMENT_ERROR;
-    $requirements['curl']['description'] = $t('The testing framework could not be installed because the PHP <a href="@curl_url">cURL</a> library is not available.', array('@curl_url' => 'http://php.net/manual/en/curl.setup.php'));
-  }
-  $requirements['hash'] = array(
-    'title' => $t('hash'),
-    'value' => $has_hash ? $t('Enabled') : $t('Not found'),
-  );
-  if (!$has_hash) {
-    $requirements['hash']['severity'] = REQUIREMENT_ERROR;
-    $requirements['hash']['description'] = $t('The testing framework could not be installed because the PHP <a href="@hash_url">hash</a> extension is disabled.', array('@hash_url' => 'http://php.net/manual/en/book.hash.php'));
-  }
-
-  $requirements['php_domdocument'] = array(
-    'title' => $t('PHP DOMDocument class'),
-    'value' => $has_domdocument ? $t('Enabled') : $t('Not found'),
-  );
-  if (!$has_domdocument) {
-    $requirements['php_domdocument']['severity'] = REQUIREMENT_ERROR;
-    $requirements['php_domdocument']['description'] =t('The testing framework requires the DOMDocument class to be available. Check the configure command at the <a href="@link-phpinfo">PHP info page</a>.', array('@link-phpinfo' => url('admin/reports/status/php')));
-  }
-
-  // SimpleTest currently needs 2 cURL options which are incompatible with
-  // having PHP's open_basedir restriction set.
-  // See http://drupal.org/node/674304.
-  $requirements['php_open_basedir'] = array(
-    'title' => $t('PHP open_basedir restriction'),
-    'value' => $open_basedir ? $t('Enabled') : $t('Disabled'),
-  );
-  if ($open_basedir) {
-    $requirements['php_open_basedir']['severity'] = REQUIREMENT_ERROR;
-    $requirements['php_open_basedir']['description'] = t('The testing framework requires the PHP <a href="@open_basedir-url">open_basedir</a> restriction to be disabled. Check your webserver configuration or contact your web host.', array('@open_basedir-url' => 'http://php.net/manual/en/ini.core.php#ini.open-basedir'));
-  }
-
-  return $requirements;
-}
-
 function simpletest_schema() {
   $schema['simpletest'] = array(
     'description' => 'Stores simpletest messages',
@@ -169,3 +94,78 @@ function simpletest_schema() {
   );
   return $schema;
 }
+
+/**
+ * Check that the cURL extension exists for PHP.
+ */
+function simpletest_requirements($phase) {
+  $requirements = array();
+  $t = get_t();
+
+  $has_curl = function_exists('curl_init');
+  $has_hash = function_exists('hash_hmac');
+  $has_domdocument = class_exists('DOMDocument');
+  $open_basedir = ini_get('open_basedir');
+
+  $requirements['curl'] = array(
+    'title' => $t('cURL'),
+    'value' => $has_curl ? $t('Enabled') : $t('Not found'),
+  );
+  if (!$has_curl) {
+    $requirements['curl']['severity'] = REQUIREMENT_ERROR;
+    $requirements['curl']['description'] = $t('The testing framework could not be installed because the PHP <a href="@curl_url">cURL</a> library is not available.', array('@curl_url' => 'http://php.net/manual/en/curl.setup.php'));
+  }
+  $requirements['hash'] = array(
+    'title' => $t('hash'),
+    'value' => $has_hash ? $t('Enabled') : $t('Not found'),
+  );
+  if (!$has_hash) {
+    $requirements['hash']['severity'] = REQUIREMENT_ERROR;
+    $requirements['hash']['description'] = $t('The testing framework could not be installed because the PHP <a href="@hash_url">hash</a> extension is disabled.', array('@hash_url' => 'http://php.net/manual/en/book.hash.php'));
+  }
+
+  $requirements['php_domdocument'] = array(
+    'title' => $t('PHP DOMDocument class'),
+    'value' => $has_domdocument ? $t('Enabled') : $t('Not found'),
+  );
+  if (!$has_domdocument) {
+    $requirements['php_domdocument']['severity'] = REQUIREMENT_ERROR;
+    $requirements['php_domdocument']['description'] =t('The testing framework requires the DOMDocument class to be available. Check the configure command at the <a href="@link-phpinfo">PHP info page</a>.', array('@link-phpinfo' => url('admin/reports/status/php')));
+  }
+
+  // SimpleTest currently needs 2 cURL options which are incompatible with
+  // having PHP's open_basedir restriction set.
+  // See http://drupal.org/node/674304.
+  $requirements['php_open_basedir'] = array(
+    'title' => $t('PHP open_basedir restriction'),
+    'value' => $open_basedir ? $t('Enabled') : $t('Disabled'),
+  );
+  if ($open_basedir) {
+    $requirements['php_open_basedir']['severity'] = REQUIREMENT_ERROR;
+    $requirements['php_open_basedir']['description'] = t('The testing framework requires the PHP <a href="@open_basedir-url">open_basedir</a> restriction to be disabled. Check your webserver configuration or contact your web host.', array('@open_basedir-url' => 'http://php.net/manual/en/ini.core.php#ini.open-basedir'));
+  }
+
+  return $requirements;
+}
+
+/**
+ * Implements hook_uninstall().
+ */
+function simpletest_uninstall() {
+  simpletest_clean_environment();
+
+  // Remove settings variables.
+  variable_del('simpletest_httpauth_method');
+  variable_del('simpletest_httpauth_username');
+  variable_del('simpletest_httpauth_password');
+  variable_del('simpletest_clear_results');
+  variable_del('simpletest_verbose');
+
+  // Remove generated files.
+  $path = 'public://simpletest';
+  $files = file_scan_directory($path, '/.*/');
+  foreach ($files as $file) {
+    file_unmanaged_delete($file->uri);
+  }
+  drupal_rmdir($path);
+}
Index: modules/statistics/statistics.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.install,v
retrieving revision 1.27
diff -u -p -r1.27 statistics.install
--- modules/statistics/statistics.install	22 Aug 2010 13:55:53 -0000	1.27
+++ modules/statistics/statistics.install	5 Oct 2010 04:42:54 -0000
@@ -7,20 +7,6 @@
  */
 
 /**
- * Implements hook_uninstall().
- */
-function statistics_uninstall() {
-  // Remove variables.
-  variable_del('statistics_count_content_views');
-  variable_del('statistics_enable_access_log');
-  variable_del('statistics_flush_accesslog_timer');
-  variable_del('statistics_day_timestamp');
-  variable_del('statistics_block_top_day_num');
-  variable_del('statistics_block_top_all_num');
-  variable_del('statistics_block_top_last_num');
-}
-
-/**
  * Implements hook_schema().
  */
 function statistics_schema() {
@@ -137,6 +123,20 @@ function statistics_schema() {
 }
 
 /**
+ * Implements hook_uninstall().
+ */
+function statistics_uninstall() {
+  // Remove variables.
+  variable_del('statistics_count_content_views');
+  variable_del('statistics_enable_access_log');
+  variable_del('statistics_flush_accesslog_timer');
+  variable_del('statistics_day_timestamp');
+  variable_del('statistics_block_top_day_num');
+  variable_del('statistics_block_top_all_num');
+  variable_del('statistics_block_top_last_num');
+}
+
+/**
  * @defgroup updates-6.x-to-7.x statistics updates from 6.x to 7.x
  * @{
  */
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.513
diff -u -p -r1.513 system.install
--- modules/system/system.install	5 Oct 2010 00:31:19 -0000	1.513
+++ modules/system/system.install	5 Oct 2010 04:42:55 -0000
@@ -7,788 +7,309 @@
  */
 
 /**
- * Test and report Drupal installation requirements.
- *
- * @param $phase
- *   The current system installation phase.
- * @return
- *   An array of system requirements.
+ * Implements hook_schema().
  */
-function system_requirements($phase) {
-  global $base_url;
-  $requirements = array();
-  // Ensure translations don't break at install time
-  $t = get_t();
-
-  // Report Drupal version
-  if ($phase == 'runtime') {
-    $requirements['drupal'] = array(
-      'title' => $t('Drupal'),
-      'value' => VERSION,
-      'severity' => REQUIREMENT_INFO,
-      'weight' => -10,
-    );
-
-    // Display the currently active install profile, if the site
-    // is not running the default install profile.
-    $profile = drupal_get_profile();
-    if ($profile != 'standard') {
-      $info = install_profile_info($profile);
-      $requirements['install_profile'] = array(
-        'title' => $t('Install profile'),
-        'value' => $t('%profile_name (%profile-%version)', array(
-          '%profile_name' => $info['name'],
-          '%profile' => $profile,
-          '%version' => $info['version']
-        )),
-        'severity' => REQUIREMENT_INFO,
-        'weight' => -9
-      );
-    }
-  }
-
-  // Web server information.
-  $software = $_SERVER['SERVER_SOFTWARE'];
-  $requirements['webserver'] = array(
-    'title' => $t('Web server'),
-    'value' => $software,
+function system_schema() {
+  // NOTE: {variable} needs to be created before all other tables, as
+  // some database drivers, e.g. Oracle and DB2, will require variable_get()
+  // and variable_set() for overcoming some database specific limitations.
+  $schema['variable'] = array(
+    'description' => 'Named variable/value pairs created by Drupal core or any other module or theme. All variables are cached in memory at the start of every Drupal request so developers should not be careless about what is stored here.',
+    'fields' => array(
+      'name' => array(
+        'description' => 'The name of the variable.',
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'value' => array(
+        'description' => 'The value of the variable.',
+        'type' => 'blob',
+        'not null' => TRUE,
+        'size' => 'big',
+        'translatable' => TRUE,
+      ),
+    ),
+    'primary key' => array('name'),
   );
 
-  // Test PHP version and show link to phpinfo() if it's available
-  $phpversion = phpversion();
-  if (function_exists('phpinfo')) {
-    $requirements['php'] = array(
-      'title' => $t('PHP'),
-      'value' => ($phase == 'runtime') ? $phpversion .' ('. l($t('more information'), 'admin/reports/status/php') .')' : $phpversion,
-    );
-  }
-  else {
-    $requirements['php'] = array(
-      'title' => $t('PHP'),
-      'value' => $phpversion,
-      'description' => $t('The phpinfo() function has been disabled for security reasons. To see your server\'s phpinfo() information, change your PHP settings or contact your server administrator. For more information, <a href="@phpinfo">Enabling and disabling phpinfo()</a> handbook page.', array('@phpinfo' => 'http://drupal.org/node/243993')),
-      'severity' => REQUIREMENT_INFO,
-    );
-  }
-
-  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));
-    $requirements['php']['severity'] = REQUIREMENT_ERROR;
-    // If PHP is old, it's not safe to continue with the requirements check.
-    return $requirements;
-  }
-
-  // Test PHP register_globals setting.
-  $requirements['php_register_globals'] = array(
-    'title' => $t('PHP register globals'),
+  $schema['actions'] = array(
+    'description' => 'Stores action information.',
+    'fields' => array(
+      'aid' => array(
+        'description' => 'Primary Key: Unique actions ID.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '0',
+      ),
+      'type' => array(
+        'description' => 'The object that that action acts on (node, user, comment, system or custom types.)',
+        'type' => 'varchar',
+        'length' => 32,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'callback' => array(
+        'description' => 'The callback function that executes when the action runs.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'parameters' => array(
+        'description' => 'Parameters to be passed to the callback function.',
+        'type' => 'blob',
+        'not null' => TRUE,
+        'size' => 'big',
+      ),
+      'label' => array(
+        'description' => 'Label of the action.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '0',
+      ),
+    ),
+    'primary key' => array('aid'),
   );
-  $register_globals = trim(ini_get('register_globals'));
-  // Unfortunately, ini_get() may return many different values, and we can't
-  // be certain which values mean 'on', so we instead check for 'not off'
-  // since we never want to tell the user that their site is secure
-  // (register_globals off), when it is in fact on. We can only guarantee
-  // register_globals is off if the value returned is 'off', '', or 0.
-  if (!empty($register_globals) && strtolower($register_globals) != 'off') {
-    $requirements['php_register_globals']['description'] = $t('<em>register_globals</em> is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when <em>register_globals</em> is enabled. The PHP manual has instructions for <a href="http://php.net/configuration.changes">how to change configuration settings</a>.');
-    $requirements['php_register_globals']['severity'] = REQUIREMENT_ERROR;
-    $requirements['php_register_globals']['value'] = $t("Enabled ('@value')", array('@value' => $register_globals));
-  }
-  else {
-    $requirements['php_register_globals']['value'] = $t('Disabled');
-  }
 
-  // Test for PHP extensions.
-  $requirements['php_extensions'] = array(
-    'title' => $t('PHP extensions'),
+  $schema['batch'] = array(
+    'description' => 'Stores details about batches (processes that run in multiple HTTP requests).',
+    'fields' => array(
+      'bid' => array(
+        'description' => 'Primary Key: Unique batch ID.',
+        // This is not a serial column, to allow both progressive and
+        // non-progressive batches. See batch_process().
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'token' => array(
+        'description' => "A string token generated against the current user's session id and the batch id, used to ensure that only the user who submitted the batch can effectively access it.",
+        'type' => 'varchar',
+        'length' => 64,
+        'not null' => TRUE,
+      ),
+      'timestamp' => array(
+        'description' => 'A Unix timestamp indicating when this batch was submitted for processing. Stale batches are purged at cron time.',
+        'type' => 'int',
+        'not null' => TRUE,
+      ),
+      'batch' => array(
+        'description' => 'A serialized array containing the processing data for the batch.',
+        'type' => 'blob',
+        'not null' => FALSE,
+        'size' => 'big',
+      ),
+    ),
+    'primary key' => array('bid'),
+    'indexes' => array(
+      'token' => array('token'),
+    ),
   );
 
-  $missing_extensions = array();
-  $required_extensions = array(
-    'date',
-    'dom',
-    'filter',
-    'gd',
-    'hash',
-    'json',
-    'pcre',
-    'pdo',
-    'session',
-    'SimpleXML',
-    'SPL',
-    'xml',
+  $schema['blocked_ips'] = array(
+    'description' => 'Stores blocked IP addresses.',
+    'fields' => array(
+       'iid' => array(
+        'description' => 'Primary Key: unique ID for IP addresses.',
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'ip' => array(
+        'description' => 'IP address',
+        'type' => 'varchar',
+        'length' => 40,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+    ),
+    'indexes' => array(
+      'blocked_ip' => array('ip'),
+    ),
+    'primary key' => array('iid'),
   );
-  foreach ($required_extensions as $extension) {
-    if (!extension_loaded($extension)) {
-      $missing_extensions[] = $extension;
-    }
-  }
 
-  if (!empty($missing_extensions)) {
-    $description = $t('Drupal requires you to enable the PHP extensions in the following list (see the <a href="@system_requirements">system requirements page</a> for more information):', array(
-      '@system_requirements' => 'http://drupal.org/requirements',
-    ));
-
-    $description .= theme('item_list',  array(
-      'type' => 'ul',
-      'items' => $missing_extensions,
-    ));
-
-    $requirements['php_extensions']['value'] = $t('Disabled');
-    $requirements['php_extensions']['severity'] = REQUIREMENT_ERROR;
-    $requirements['php_extensions']['description'] = $description;
-  }
-  else {
-    $requirements['php_extensions']['value'] = $t('Enabled');
-  }
-
-  if ($phase == 'install' || $phase == 'update') {
-    // Test for PDO (database).
-    $requirements['database_extensions'] = array(
-      'title' => $t('Database support'),
-    );
-
-    // Test for at least one suitable PDO extension, if PDO is available.
-    $database_ok = extension_loaded('pdo');
-    if ($database_ok) {
-      $drivers = drupal_detect_database_types();
-      $database_ok = !empty($drivers);
-    }
-
-    if (!$database_ok) {
-      $requirements['database_extensions']['value'] = $t('Disabled');
-      $requirements['database_extensions']['severity'] = REQUIREMENT_ERROR;
-      $requirements['database_extensions']['description'] = $t('Your web server does not appear to support any common PDO database extensions. Check with your hosting provider to see if they support PDO (PHP Data Objects) and offer any databases that <a href="@drupal-databases">Drupal supports</a>.', array(
-        '@drupal-databases' => 'http://drupal.org/node/270#database',
-      ));
-    }
-    else {
-      $requirements['database_extensions']['value'] = $t('Enabled');
-    }
-  }
-
-  // Test PHP memory_limit
-  $memory_limit = ini_get('memory_limit');
-  $requirements['php_memory_limit'] = array(
-    'title' => $t('PHP memory limit'),
-    'value' => $memory_limit == -1 ? t('-1 (Unlimited)') : $memory_limit,
+  $schema['cache'] = array(
+    'description' => 'Generic cache table for caching things not separated out into their own tables. Contributed modules may also use this to store cached items.',
+    'fields' => array(
+      'cid' => array(
+        'description' => 'Primary Key: Unique cache ID.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'data' => array(
+        'description' => 'A collection of data to cache.',
+        'type' => 'blob',
+        'not null' => FALSE,
+        'size' => 'big',
+      ),
+      'expire' => array(
+        'description' => 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'created' => array(
+        'description' => 'A Unix timestamp indicating when the cache entry was created.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'serialized' => array(
+        'description' => 'A flag to indicate whether content is serialized (1) or not (0).',
+        'type' => 'int',
+        'size' => 'small',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+    ),
+    'indexes' => array(
+      'expire' => array('expire'),
+    ),
+    'primary key' => array('cid'),
   );
+  $schema['cache_bootstrap'] = $schema['cache'];
+  $schema['cache_bootstrap']['description'] = 'Cache table for data required to bootstrap Drupal, may be routed to a shared memory cache.';
+  $schema['cache_form'] = $schema['cache'];
+  $schema['cache_form']['description'] = 'Cache table for the form system to store recently built forms and their storage data, to be used in subsequent page requests.';
+  $schema['cache_page'] = $schema['cache'];
+  $schema['cache_page']['description'] = 'Cache table used to store compressed pages for anonymous users, if page caching is enabled.';
+  $schema['cache_menu'] = $schema['cache'];
+  $schema['cache_menu']['description'] = 'Cache table for the menu system to store router information as well as generated link trees for various menu/page/user combinations.';
+  $schema['cache_path'] = $schema['cache'];
+  $schema['cache_path']['description'] = 'Cache table for path alias lookup.';
 
-  if ($memory_limit && $memory_limit != -1 && parse_size($memory_limit) < parse_size(DRUPAL_MINIMUM_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));
-    }
-    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));
-    }
-    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));
-    }
-
-    if (!empty($description)) {
-      if ($php_ini_path = get_cfg_var('cfg_file_path')) {
-        $description .= ' ' . $t('Increase the memory limit by editing the memory_limit parameter in the file %configuration-file and then restart your web server (or contact your system administrator or hosting provider for assistance).', array('%configuration-file' => $php_ini_path));
-      }
-      else {
-        $description .= ' ' . $t('Contact your system administrator or hosting provider for assistance with increasing your PHP memory limit.');
-      }
-
-      $requirements['php_memory_limit']['description'] = $description . ' ' . $t('See the <a href="@url">Drupal requirements</a> for more information.', array('@url' => 'http://drupal.org/requirements'));
-      $requirements['php_memory_limit']['severity'] = REQUIREMENT_WARNING;
-    }
-  }
-
-  // Test settings.php file writability
-  if ($phase == 'runtime') {
-    $conf_dir = drupal_verify_install_file(conf_path(), FILE_NOT_WRITABLE, 'dir');
-    $conf_file = drupal_verify_install_file(conf_path() . '/settings.php', FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE);
-    if (!$conf_dir || !$conf_file) {
-      $requirements['settings.php'] = array(
-        'value' => $t('Not protected'),
-        'severity' => REQUIREMENT_ERROR,
-        'description' => '',
-      );
-      if (!$conf_dir) {
-        $requirements['settings.php']['description'] .= $t('The directory %file is not protected from modifications and poses a security risk. You must change the directory\'s permissions to be non-writable. ', array('%file' => conf_path()));
-      }
-      if (!$conf_file) {
-        $requirements['settings.php']['description'] .= $t('The file %file is not protected from modifications and poses a security risk. You must change the file\'s permissions to be non-writable.', array('%file' => conf_path() . '/settings.php'));
-      }
-    }
-    else {
-      $requirements['settings.php'] = array(
-        'value' => $t('Protected'),
-      );
-    }
-    $requirements['settings.php']['title'] = $t('Configuration file');
-  }
-
-  // Report cron status.
-  if ($phase == 'runtime') {
-    // Cron warning threshold defaults to two days.
-    $threshold_warning = variable_get('cron_threshold_warning', 172800);
-    // Cron error threshold defaults to two weeks.
-    $threshold_error = variable_get('cron_threshold_error', 1209600);
-    // Cron configuration help text.
-    $help = $t('For more information, see the online handbook entry for <a href="@cron-handbook">configuring cron jobs</a>.', array('@cron-handbook' => 'http://drupal.org/cron'));
-
-    // Determine when cron last ran.
-    $cron_last = variable_get('cron_last');
-    if (!is_numeric($cron_last)) {
-      $cron_last = variable_get('install_time', 0);
-    }
-
-    // Determine severity based on time since cron last ran.
-    $severity = REQUIREMENT_OK;
-    if (REQUEST_TIME - $cron_last > $threshold_error) {
-      $severity = REQUIREMENT_ERROR;
-    }
-    elseif (REQUEST_TIME - $cron_last > $threshold_warning) {
-      $severity = REQUIREMENT_WARNING;
-    }
-
-    // Set summary and description based on values determined above.
-    $summary = $t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last)));
-    $description = '';
-    if ($severity != REQUIREMENT_OK) {
-      $description = $t('Cron has not run recently.') . ' ' . $help;
-    }
-
-    $description .= ' ' . $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron')));
-    $description .= '<br />' . $t('To run cron from outside the site, go to <a href="!cron">!cron</a>', array('!cron' => url($base_url . '/cron.php', array('external' => TRUE, 'query' => array('cron_key' => variable_get('cron_key', 'drupal'))))));
-
-    $requirements['cron'] = array(
-      'title' => $t('Cron maintenance tasks'),
-      'severity' => $severity,
-      'value' => $summary,
-      'description' => $description
-    );
-  }
-
-  // Test files directories.
-  $directories = array(
-    variable_get('file_public_path', conf_path() . '/files'),
-    // By default no private files directory is configured. For private files
-    // to be secure the admin needs to provide a path outside the webroot.
-    variable_get('file_private_path', FALSE),
+  $schema['date_format_type'] = array(
+    'description' => 'Stores configured date format types.',
+    'fields' => array(
+      'type' => array(
+        'description' => 'The date format type, e.g. medium.',
+        'type' => 'varchar',
+        'length' => 64,
+        'not null' => TRUE,
+      ),
+      'title' => array(
+        'description' => 'The human readable name of the format type.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+      ),
+      'locked' => array(
+        'description' => 'Whether or not this is a system provided format.',
+        'type' => 'int',
+        'size' => 'tiny',
+        'default' => 0,
+        'not null' => TRUE,
+      ),
+    ),
+    'primary key' => array('type'),
+    'indexes' => array(
+      'title' => array('title'),
+    ),
   );
 
-  // Do not check for the temporary files directory at install time
-  // unless it has been set in settings.php. In this case the user has
-  // no alternative but to fix the directory if it is not writable.
-  if ($phase == 'install') {
-    $directories[] = variable_get('file_temporary_path', FALSE);
-  }
-  else {
-    $directories[] = variable_get('file_temporary_path', file_directory_temp());
-  }
-
-  $requirements['file system'] = array(
-    'title' => $t('File system'),
+  // This table's name is plural as some versions of MySQL can't create a
+  // table named 'date_format'.
+  $schema['date_formats'] = array(
+    'description' => 'Stores configured date formats.',
+    'fields' => array(
+      'dfid' => array(
+        'description' => 'The date format identifier.',
+        'type' => 'serial',
+        'not null' => TRUE,
+        'unsigned' => TRUE,
+      ),
+      'format' => array(
+        'description' => 'The date format string.',
+        'type' => 'varchar',
+        'length' => 100,
+        'not null' => TRUE,
+      ),
+      'type' => array(
+        'description' => 'The date format type, e.g. medium.',
+        'type' => 'varchar',
+        'length' => 64,
+        'not null' => TRUE,
+      ),
+      'locked' => array(
+        'description' => 'Whether or not this format can be modified.',
+        'type' => 'int',
+        'size' => 'tiny',
+        'default' => 0,
+        'not null' => TRUE,
+      ),
+    ),
+    'primary key' => array('dfid'),
+    'unique keys' => array('formats' => array('format', 'type')),
   );
 
-  $error = '';
-  // For installer, create the directories if possible.
-  foreach ($directories as $directory) {
-    if (!$directory) {
-      continue;
-    }
-    if ($phase == 'install') {
-      file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
-    }
-    $is_writable = is_writable($directory);
-    $is_directory = is_dir($directory);
-    if (!$is_writable || !$is_directory) {
-      $description = '';
-      $requirements['file system']['value'] = $t('Not writable');
-      if (!$is_directory) {
-        $error .= $t('The directory %directory does not exist.', array('%directory' => $directory)) . ' ';
-      }
-      else {
-        $error .= $t('The directory %directory is not writable.', array('%directory' => $directory)) . ' ';
-      }
-      // The files directory requirement check is done only during install and runtime.
-      if ($phase == 'runtime') {
-        $description = $error . $t('You may need to set the correct directory at the <a href="@admin-file-system">file system settings page</a> or change the current directory\'s permissions so that it is writable.', array('@admin-file-system' => url('admin/config/media/file-system')));
-      }
-      elseif ($phase == 'install') {
-        // For the installer UI, we need different wording. 'value' will
-        // be treated as version, so provide none there.
-        $description = $error . $t('An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see INSTALL.txt or the <a href="@handbook_url">online handbook</a>.', array('@handbook_url' => 'http://drupal.org/server-permissions'));
-        $requirements['file system']['value'] = '';
-      }
-      if (!empty($description)) {
-        $requirements['file system']['description'] = $description;
-        $requirements['file system']['severity'] = REQUIREMENT_ERROR;
-      }
-    }
-    else {
-      if (file_default_scheme() == 'public') {
-        $requirements['file system']['value'] = $t('Writable (<em>public</em> download method)');
-      }
-      else {
-        $requirements['file system']['value'] = $t('Writable (<em>private</em> download method)');
-      }
-    }
-  }
-
-  // See if updates are available in update.php.
-  if ($phase == 'runtime') {
-    $requirements['update'] = array(
-      'title' => $t('Database updates'),
-      'severity' => REQUIREMENT_OK,
-      'value' => $t('Up to date'),
-    );
-
-    // Check installed modules.
-    foreach (module_list() as $module) {
-      $updates = drupal_get_schema_versions($module);
-      if ($updates !== FALSE) {
-        $default = drupal_get_installed_schema_version($module);
-        if (max($updates) > $default) {
-          $requirements['update']['severity'] = REQUIREMENT_ERROR;
-          $requirements['update']['value'] = $t('Out of date');
-          $requirements['update']['description'] = $t('Some modules have database schema updates to install. You should run the <a href="@update">database update script</a> immediately.', array('@update' => base_path() . 'update.php'));
-          break;
-        }
-      }
-    }
-  }
-
-  // Verify the update.php access setting
-  if ($phase == 'runtime') {
-    if (!empty($GLOBALS['update_free_access'])) {
-      $requirements['update access'] = array(
-        'value' => $t('Not protected'),
-        'severity' => REQUIREMENT_ERROR,
-        'description' => $t('The update.php script is accessible to everyone without authentication check, which is a security risk. You must change the $update_free_access value in your settings.php back to FALSE.'),
-      );
-    }
-    else {
-      $requirements['update access'] = array(
-        'value' => $t('Protected'),
-      );
-    }
-    $requirements['update access']['title'] = $t('Access to update.php');
-  }
-
-  // Display an error if a newly introduced dependency in a module is not resolved.
-  if ($phase == 'update') {
-    $profile = drupal_get_profile();
-    $files = system_rebuild_module_data();
-    foreach ($files as $module => $file) {
-      // Ignore disabled modules and install profiles.
-      if (!$file->status || $module == $profile) {
-        continue;
-      }
-      // Check the module's PHP version.
-      $name = $file->info['name'];
-      $php = $file->info['php'];
-      if (version_compare($php, PHP_VERSION, '>')) {
-        $requirements['php']['description'] .= $t('@name requires at least PHP @version.', array('@name' => $name, '@version' => $php));
-        $requirements['php']['severity'] = REQUIREMENT_ERROR;
-      }
-      // Check the module's required modules.
-      foreach ($file->requires as $requirement) {
-        $required_module = $requirement['name'];
-        // Check if the module exists.
-        if (!isset($files[$required_module])) {
-          $requirements["$module-$required_module"] = array(
-            'title' => $t('Unresolved dependency'),
-            'description' => $t('@name requires this module.', array('@name' => $name)),
-            'value' => t('@required_name (Missing)', array('@required_name' => $required_module)),
-            'severity' => REQUIREMENT_ERROR,
-          );
-          continue;
-        }
-        // Check for an incompatible version.
-        $required_file = $files[$required_module];
-        $required_name = $required_file->info['name'];
-        $version = str_replace(DRUPAL_CORE_COMPATIBILITY . '-', '', $required_file->info['version']);
-        $compatibility = drupal_check_incompatibility($requirement, $version);
-        if ($compatibility) {
-          $compatibility = rtrim(substr($compatibility, 2), ')');
-          $requirements["$module-$required_module"] = array(
-            'title' => $t('Unresolved dependency'),
-            'description' => $t('@name requires this module and version. Currently using @required_name version @version', array('@name' => $name, '@required_name' => $required_name, '@version' => $version)),
-            'value' => t('@required_name (Version @compatibility required)', array('@required_name' => $required_name, '@compatibility' => $compatibility)),
-            'severity' => REQUIREMENT_ERROR,
-          );
-          continue;
-        }
-      }
-    }
-  }
-
-  // Test Unicode library
-  include_once DRUPAL_ROOT . '/includes/unicode.inc';
-  $requirements = array_merge($requirements, unicode_requirements());
-
-  if ($phase == 'runtime') {
-    // Check for update status module.
-    if (!module_exists('update')) {
-      $requirements['update status'] = array(
-        'value' => $t('Not enabled'),
-        'severity' => REQUIREMENT_WARNING,
-        'description' => $t('Update notifications are not enabled. It is <strong>highly recommended</strong> that you enable the update status module from the <a href="@module">module administration page</a> in order to stay up-to-date on new releases. For more information, <a href="@update">Update status handbook page</a>.', array('@update' => 'http://drupal.org/handbook/modules/update', '@module' => url('admin/modules'))),
-      );
-    }
-    else {
-      $requirements['update status'] = array(
-        'value' => $t('Enabled'),
-      );
-    }
-    $requirements['update status']['title'] = $t('Update notifications');
-
-    // Check that Drupal can issue HTTP requests.
-    if (variable_get('drupal_http_request_fails', TRUE) && !system_check_http_request()) {
-      $requirements['http requests'] = array(
-        'title' => $t('HTTP request status'),
-        'value' => $t('Fails'),
-        'severity' => REQUIREMENT_ERROR,
-        'description' => $t('Your system or network configuration does not allow Drupal to access web pages, resulting in reduced functionality. This could be due to your webserver configuration or PHP settings, and should be resolved in order to download information about available updates, fetch aggregator feeds, sign in via OpenID, or use other network-dependent services. If you are certain that Drupal can access web pages but you are still seeing this message, you may add <code>$conf[\'drupal_http_request_fails\'] = FALSE;</code> to the bottom of your settings.php file.'),
-      );
-    }
-  }
-
-  return $requirements;
-}
-
-/**
- * Implements hook_install().
- */
-function system_install() {
-  // Create tables.
-  drupal_install_schema('system');
-  $versions = drupal_get_schema_versions('system');
-  $version = $versions ? max($versions) : SCHEMA_INSTALLED;
-  drupal_set_installed_schema_version('system', $version);
-
-  // Clear out module list and hook implementation statics before calling
-  // system_rebuild_theme_data().
-  module_list(TRUE);
-  module_implements('', FALSE, TRUE);
-
-  // Load system theme data appropriately.
-  system_rebuild_theme_data();
-
-  // Enable the default theme.
-  variable_set('theme_default', 'bartik');
-  db_update('system')
-    ->fields(array('status' => 1))
-    ->condition('type', 'theme')
-    ->condition('name', 'bartik')
-    ->execute();
-
-  // Populate the cron key variable.
-  $cron_key = drupal_hash_base64(drupal_random_bytes(55));
-  variable_set('cron_key', $cron_key);
-}
-
-/**
- * Implements hook_schema().
- */
-function system_schema() {
-  // NOTE: {variable} needs to be created before all other tables, as
-  // some database drivers, e.g. Oracle and DB2, will require variable_get()
-  // and variable_set() for overcoming some database specific limitations.
-  $schema['variable'] = array(
-    'description' => 'Named variable/value pairs created by Drupal core or any other module or theme. All variables are cached in memory at the start of every Drupal request so developers should not be careless about what is stored here.',
+  $schema['date_format_locale'] = array(
+    'description' => 'Stores configured date formats for each locale.',
     'fields' => array(
-      'name' => array(
-        'description' => 'The name of the variable.',
+      'format' => array(
+        'description' => 'The date format string.',
         'type' => 'varchar',
-        'length' => 128,
+        'length' => 100,
         'not null' => TRUE,
-        'default' => '',
       ),
-      'value' => array(
-        'description' => 'The value of the variable.',
-        'type' => 'blob',
+      'type' => array(
+        'description' => 'The date format type, e.g. medium.',
+        'type' => 'varchar',
+        'length' => 64,
+        'not null' => TRUE,
+      ),
+      'language' => array(
+        'description' => 'A {languages}.language for this format to be used with.',
+        'type' => 'varchar',
+        'length' => 12,
         'not null' => TRUE,
-        'size' => 'big',
-        'translatable' => TRUE,
       ),
     ),
-    'primary key' => array('name'),
+    'primary key' => array('type', 'language'),
   );
 
-  $schema['actions'] = array(
-    'description' => 'Stores action information.',
+  $schema['file_managed'] = array(
+    'description' => 'Stores information for uploaded files.',
     'fields' => array(
-      'aid' => array(
-        'description' => 'Primary Key: Unique actions ID.',
-        'type' => 'varchar',
-        'length' => 255,
+      'fid' => array(
+        'description' => 'File ID.',
+        'type' => 'serial',
+        'unsigned' => TRUE,
         'not null' => TRUE,
-        'default' => '0',
       ),
-      'type' => array(
-        'description' => 'The object that that action acts on (node, user, comment, system or custom types.)',
-        'type' => 'varchar',
-        'length' => 32,
+      'uid' => array(
+        'description' => 'The {users}.uid of the user who is associated with the file.',
+        'type' => 'int',
+        'unsigned' => TRUE,
         'not null' => TRUE,
-        'default' => '',
+        'default' => 0,
       ),
-      'callback' => array(
-        'description' => 'The callback function that executes when the action runs.',
+      'filename' => array(
+        'description' => 'Name of the file with no path components. This may differ from the basename of the URI if the file is renamed to avoid overwriting an existing file.',
         'type' => 'varchar',
         'length' => 255,
         'not null' => TRUE,
         'default' => '',
       ),
-      'parameters' => array(
-        'description' => 'Parameters to be passed to the callback function.',
-        'type' => 'blob',
+      'uri' => array(
+        'description' => 'The URI to access the file (either local or remote).',
+        'type' => 'varchar',
+        'length' => 255,
         'not null' => TRUE,
-        'size' => 'big',
+        'default' => '',
       ),
-      'label' => array(
-        'description' => 'Label of the action.',
+      'filemime' => array(
+        'description' => "The file's MIME type.",
         'type' => 'varchar',
         'length' => 255,
         'not null' => TRUE,
-        'default' => '0',
-      ),
-    ),
-    'primary key' => array('aid'),
-  );
-
-  $schema['batch'] = array(
-    'description' => 'Stores details about batches (processes that run in multiple HTTP requests).',
-    'fields' => array(
-      'bid' => array(
-        'description' => 'Primary Key: Unique batch ID.',
-        // This is not a serial column, to allow both progressive and
-        // non-progressive batches. See batch_process().
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-      ),
-      'token' => array(
-        'description' => "A string token generated against the current user's session id and the batch id, used to ensure that only the user who submitted the batch can effectively access it.",
-        'type' => 'varchar',
-        'length' => 64,
-        'not null' => TRUE,
-      ),
-      'timestamp' => array(
-        'description' => 'A Unix timestamp indicating when this batch was submitted for processing. Stale batches are purged at cron time.',
-        'type' => 'int',
-        'not null' => TRUE,
-      ),
-      'batch' => array(
-        'description' => 'A serialized array containing the processing data for the batch.',
-        'type' => 'blob',
-        'not null' => FALSE,
-        'size' => 'big',
-      ),
-    ),
-    'primary key' => array('bid'),
-    'indexes' => array(
-      'token' => array('token'),
-    ),
-  );
-
-  $schema['blocked_ips'] = array(
-    'description' => 'Stores blocked IP addresses.',
-    'fields' => array(
-       'iid' => array(
-        'description' => 'Primary Key: unique ID for IP addresses.',
-        'type' => 'serial',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-      ),
-      'ip' => array(
-        'description' => 'IP address',
-        'type' => 'varchar',
-        'length' => 40,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-    ),
-    'indexes' => array(
-      'blocked_ip' => array('ip'),
-    ),
-    'primary key' => array('iid'),
-  );
-
-  $schema['cache'] = array(
-    'description' => 'Generic cache table for caching things not separated out into their own tables. Contributed modules may also use this to store cached items.',
-    'fields' => array(
-      'cid' => array(
-        'description' => 'Primary Key: Unique cache ID.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'data' => array(
-        'description' => 'A collection of data to cache.',
-        'type' => 'blob',
-        'not null' => FALSE,
-        'size' => 'big',
-      ),
-      'expire' => array(
-        'description' => 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'created' => array(
-        'description' => 'A Unix timestamp indicating when the cache entry was created.',
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'serialized' => array(
-        'description' => 'A flag to indicate whether content is serialized (1) or not (0).',
-        'type' => 'int',
-        'size' => 'small',
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-    ),
-    'indexes' => array(
-      'expire' => array('expire'),
-    ),
-    'primary key' => array('cid'),
-  );
-  $schema['cache_bootstrap'] = $schema['cache'];
-  $schema['cache_bootstrap']['description'] = 'Cache table for data required to bootstrap Drupal, may be routed to a shared memory cache.';
-  $schema['cache_form'] = $schema['cache'];
-  $schema['cache_form']['description'] = 'Cache table for the form system to store recently built forms and their storage data, to be used in subsequent page requests.';
-  $schema['cache_page'] = $schema['cache'];
-  $schema['cache_page']['description'] = 'Cache table used to store compressed pages for anonymous users, if page caching is enabled.';
-  $schema['cache_menu'] = $schema['cache'];
-  $schema['cache_menu']['description'] = 'Cache table for the menu system to store router information as well as generated link trees for various menu/page/user combinations.';
-  $schema['cache_path'] = $schema['cache'];
-  $schema['cache_path']['description'] = 'Cache table for path alias lookup.';
-
-  $schema['date_format_type'] = array(
-    'description' => 'Stores configured date format types.',
-    'fields' => array(
-      'type' => array(
-        'description' => 'The date format type, e.g. medium.',
-        'type' => 'varchar',
-        'length' => 64,
-        'not null' => TRUE,
-      ),
-      'title' => array(
-        'description' => 'The human readable name of the format type.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-      ),
-      'locked' => array(
-        'description' => 'Whether or not this is a system provided format.',
-        'type' => 'int',
-        'size' => 'tiny',
-        'default' => 0,
-        'not null' => TRUE,
-      ),
-    ),
-    'primary key' => array('type'),
-    'indexes' => array(
-      'title' => array('title'),
-    ),
-  );
-
-  // This table's name is plural as some versions of MySQL can't create a
-  // table named 'date_format'.
-  $schema['date_formats'] = array(
-    'description' => 'Stores configured date formats.',
-    'fields' => array(
-      'dfid' => array(
-        'description' => 'The date format identifier.',
-        'type' => 'serial',
-        'not null' => TRUE,
-        'unsigned' => TRUE,
-      ),
-      'format' => array(
-        'description' => 'The date format string.',
-        'type' => 'varchar',
-        'length' => 100,
-        'not null' => TRUE,
-      ),
-      'type' => array(
-        'description' => 'The date format type, e.g. medium.',
-        'type' => 'varchar',
-        'length' => 64,
-        'not null' => TRUE,
-      ),
-      'locked' => array(
-        'description' => 'Whether or not this format can be modified.',
-        'type' => 'int',
-        'size' => 'tiny',
-        'default' => 0,
-        'not null' => TRUE,
-      ),
-    ),
-    'primary key' => array('dfid'),
-    'unique keys' => array('formats' => array('format', 'type')),
-  );
-
-  $schema['date_format_locale'] = array(
-    'description' => 'Stores configured date formats for each locale.',
-    'fields' => array(
-      'format' => array(
-        'description' => 'The date format string.',
-        'type' => 'varchar',
-        'length' => 100,
-        'not null' => TRUE,
-      ),
-      'type' => array(
-        'description' => 'The date format type, e.g. medium.',
-        'type' => 'varchar',
-        'length' => 64,
-        'not null' => TRUE,
-      ),
-      'language' => array(
-        'description' => 'A {languages}.language for this format to be used with.',
-        'type' => 'varchar',
-        'length' => 12,
-        'not null' => TRUE,
-      ),
-    ),
-    'primary key' => array('type', 'language'),
-  );
-
-  $schema['file_managed'] = array(
-    'description' => 'Stores information for uploaded files.',
-    'fields' => array(
-      'fid' => array(
-        'description' => 'File ID.',
-        'type' => 'serial',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-      ),
-      'uid' => array(
-        'description' => 'The {users}.uid of the user who is associated with the file.',
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'filename' => array(
-        'description' => 'Name of the file with no path components. This may differ from the basename of the URI if the file is renamed to avoid overwriting an existing file.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'uri' => array(
-        'description' => 'The URI to access the file (either local or remote).',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'filemime' => array(
-        'description' => "The file's MIME type.",
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
+        'default' => '',
       ),
       'filesize' => array(
         'description' => 'The size of the file in bytes.',
@@ -1399,224 +920,703 @@ function system_schema() {
     'primary key' => array('filename'),
   );
 
-  $schema['semaphore'] = array(
-    'description' => 'Table for holding semaphores, locks, flags, etc. that cannot be stored as Drupal variables since they must not be cached.',
-    'fields' => array(
-      'name' => array(
-        'description' => 'Primary Key: Unique name.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => ''
-      ),
-      'value' => array(
-        'description' => 'A value for the semaphore.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => ''
-      ),
-      'expire' => array(
-        'description' => 'A Unix timestamp with microseconds indicating when the semaphore should expire.',
-        'type' => 'float',
-        'size' => 'big',
-        'not null' => TRUE
-      ),
-    ),
-    'indexes' => array(
-      'value' => array('value'),
-      'expire' => array('expire'),
-    ),
-    'primary key' => array('name'),
-  );
+  $schema['semaphore'] = array(
+    'description' => 'Table for holding semaphores, locks, flags, etc. that cannot be stored as Drupal variables since they must not be cached.',
+    'fields' => array(
+      'name' => array(
+        'description' => 'Primary Key: Unique name.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => ''
+      ),
+      'value' => array(
+        'description' => 'A value for the semaphore.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => ''
+      ),
+      'expire' => array(
+        'description' => 'A Unix timestamp with microseconds indicating when the semaphore should expire.',
+        'type' => 'float',
+        'size' => 'big',
+        'not null' => TRUE
+      ),
+    ),
+    'indexes' => array(
+      'value' => array('value'),
+      'expire' => array('expire'),
+    ),
+    'primary key' => array('name'),
+  );
+
+  $schema['sequences'] = array(
+    'description' => 'Stores IDs.',
+    'fields' => array(
+      'value' => array(
+        'description' => 'The value of the sequence.',
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+     ),
+    'primary key' => array('value'),
+  );
+
+  $schema['sessions'] = array(
+    'description' => "Drupal's session handlers read and write into the sessions table. Each record represents a user session, either anonymous or authenticated.",
+    'fields' => array(
+      'uid' => array(
+        'description' => 'The {users}.uid corresponding to a session, or 0 for anonymous user.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'sid' => array(
+        'description' => "A session ID. The value is generated by PHP's Session API.",
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'ssid' => array(
+        'description' => "Secure session ID. The value is generated by PHP's Session API.",
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'hostname' => array(
+        'description' => 'The IP address that last used this session ID (sid).',
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'timestamp' => array(
+        'description' => 'The Unix timestamp when this session last requested a page. Old records are purged by PHP automatically.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'cache' => array(
+        'description' => "The time of this user's last post. This is used when the site has specified a minimum_cache_lifetime. See cache_get().",
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'session' => array(
+        'description' => 'The serialized contents of $_SESSION, an array of name/value pairs that persists across page requests by this session ID. Drupal loads $_SESSION from here at the start of each request and saves it at the end.',
+        'type' => 'blob',
+        'not null' => FALSE,
+        'size' => 'big',
+      ),
+    ),
+    'primary key' => array(
+      'sid',
+      'ssid',
+    ),
+    'indexes' => array(
+      'timestamp' => array('timestamp'),
+      'uid' => array('uid'),
+      'ssid' => array('ssid'),
+    ),
+    'foreign keys' => array(
+      'session_user' => array(
+        'table' => 'users',
+        'columns' => array('uid' => 'uid'),
+      ),
+    ),
+  );
+
+  $schema['system'] = array(
+    'description' => "A list of all modules, themes, and theme engines that are or have been installed in Drupal's file system.",
+    'fields' => array(
+      'filename' => array(
+        'description' => 'The path of the primary file for this item, relative to the Drupal root; e.g. modules/node/node.module.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'name' => array(
+        'description' => 'The name of the item; e.g. node.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'type' => array(
+        'description' => 'The type of the item, either module, theme, theme_engine, or profile.',
+        'type' => 'varchar',
+        'length' => 12,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'owner' => array(
+        'description' => "A theme's 'parent' . Can be either a theme or an engine.",
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'status' => array(
+        'description' => 'Boolean indicating whether or not this item is enabled.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'bootstrap' => array(
+        'description' => "Boolean indicating whether this module is loaded during Drupal's early bootstrapping phase (e.g. even before the page cache is consulted).",
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'schema_version' => array(
+        'description' => "The module's database schema version number. -1 if the module is not installed (its tables do not exist); 0 or the largest N of the module's hook_update_N() function that has either been run or existed when the module was first installed.",
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => -1,
+        'size' => 'small',
+      ),
+      'weight' => array(
+        'description' => "The order in which this module's hooks should be invoked relative to other modules. Equal-weighted modules are ordered by name.",
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'info' => array(
+        'description' => "A serialized array containing information from the module's .info file; keys can include name, description, package, version, core, dependencies, and php.",
+        'type' => 'blob',
+        'not null' => FALSE,
+      ),
+    ),
+    'primary key' => array('filename'),
+    'indexes' => array(
+      'system_list' => array('status', 'bootstrap', 'type', 'weight', 'name'),
+      'type_name' => array('type', 'name'),
+    ),
+  );
+
+  $schema['url_alias'] = array(
+    'description' => 'A list of URL aliases for Drupal paths; a user may visit either the source or destination path.',
+    'fields' => array(
+      'pid' => array(
+        'description' => 'A unique path alias identifier.',
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'source' => array(
+        'description' => 'The Drupal path this alias is for; e.g. node/12.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'alias' => array(
+        'description' => 'The alias for this path; e.g. title-of-the-story.',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'language' => array(
+        'description' => 'The language this alias is for; if blank, the alias will be used for unknown languages. Each Drupal path can have an alias for each supported language.',
+        'type' => 'varchar',
+        'length' => 12,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+    ),
+    'primary key' => array('pid'),
+    'indexes' => array(
+      'alias_language_pid' => array('alias', 'language', 'pid'),
+      'source_language_pid' => array('source', 'language', 'pid'),
+    ),
+  );
+
+  return $schema;
+}
+
+/**
+ * Test and report Drupal installation requirements.
+ *
+ * @param $phase
+ *   The current system installation phase.
+ * @return
+ *   An array of system requirements.
+ */
+function system_requirements($phase) {
+  global $base_url;
+  $requirements = array();
+  // Ensure translations don't break at install time
+  $t = get_t();
+
+  // Report Drupal version
+  if ($phase == 'runtime') {
+    $requirements['drupal'] = array(
+      'title' => $t('Drupal'),
+      'value' => VERSION,
+      'severity' => REQUIREMENT_INFO,
+      'weight' => -10,
+    );
+
+    // Display the currently active install profile, if the site
+    // is not running the default install profile.
+    $profile = drupal_get_profile();
+    if ($profile != 'standard') {
+      $info = install_profile_info($profile);
+      $requirements['install_profile'] = array(
+        'title' => $t('Install profile'),
+        'value' => $t('%profile_name (%profile-%version)', array(
+          '%profile_name' => $info['name'],
+          '%profile' => $profile,
+          '%version' => $info['version']
+        )),
+        'severity' => REQUIREMENT_INFO,
+        'weight' => -9
+      );
+    }
+  }
+
+  // Web server information.
+  $software = $_SERVER['SERVER_SOFTWARE'];
+  $requirements['webserver'] = array(
+    'title' => $t('Web server'),
+    'value' => $software,
+  );
+
+  // Test PHP version and show link to phpinfo() if it's available
+  $phpversion = phpversion();
+  if (function_exists('phpinfo')) {
+    $requirements['php'] = array(
+      'title' => $t('PHP'),
+      'value' => ($phase == 'runtime') ? $phpversion .' ('. l($t('more information'), 'admin/reports/status/php') .')' : $phpversion,
+    );
+  }
+  else {
+    $requirements['php'] = array(
+      'title' => $t('PHP'),
+      'value' => $phpversion,
+      'description' => $t('The phpinfo() function has been disabled for security reasons. To see your server\'s phpinfo() information, change your PHP settings or contact your server administrator. For more information, <a href="@phpinfo">Enabling and disabling phpinfo()</a> handbook page.', array('@phpinfo' => 'http://drupal.org/node/243993')),
+      'severity' => REQUIREMENT_INFO,
+    );
+  }
+
+  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));
+    $requirements['php']['severity'] = REQUIREMENT_ERROR;
+    // If PHP is old, it's not safe to continue with the requirements check.
+    return $requirements;
+  }
+
+  // Test PHP register_globals setting.
+  $requirements['php_register_globals'] = array(
+    'title' => $t('PHP register globals'),
+  );
+  $register_globals = trim(ini_get('register_globals'));
+  // Unfortunately, ini_get() may return many different values, and we can't
+  // be certain which values mean 'on', so we instead check for 'not off'
+  // since we never want to tell the user that their site is secure
+  // (register_globals off), when it is in fact on. We can only guarantee
+  // register_globals is off if the value returned is 'off', '', or 0.
+  if (!empty($register_globals) && strtolower($register_globals) != 'off') {
+    $requirements['php_register_globals']['description'] = $t('<em>register_globals</em> is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when <em>register_globals</em> is enabled. The PHP manual has instructions for <a href="http://php.net/configuration.changes">how to change configuration settings</a>.');
+    $requirements['php_register_globals']['severity'] = REQUIREMENT_ERROR;
+    $requirements['php_register_globals']['value'] = $t("Enabled ('@value')", array('@value' => $register_globals));
+  }
+  else {
+    $requirements['php_register_globals']['value'] = $t('Disabled');
+  }
+
+  // Test for PHP extensions.
+  $requirements['php_extensions'] = array(
+    'title' => $t('PHP extensions'),
+  );
+
+  $missing_extensions = array();
+  $required_extensions = array(
+    'date',
+    'dom',
+    'filter',
+    'gd',
+    'hash',
+    'json',
+    'pcre',
+    'pdo',
+    'session',
+    'SimpleXML',
+    'SPL',
+    'xml',
+  );
+  foreach ($required_extensions as $extension) {
+    if (!extension_loaded($extension)) {
+      $missing_extensions[] = $extension;
+    }
+  }
+
+  if (!empty($missing_extensions)) {
+    $description = $t('Drupal requires you to enable the PHP extensions in the following list (see the <a href="@system_requirements">system requirements page</a> for more information):', array(
+      '@system_requirements' => 'http://drupal.org/requirements',
+    ));
+
+    $description .= theme('item_list',  array(
+      'type' => 'ul',
+      'items' => $missing_extensions,
+    ));
+
+    $requirements['php_extensions']['value'] = $t('Disabled');
+    $requirements['php_extensions']['severity'] = REQUIREMENT_ERROR;
+    $requirements['php_extensions']['description'] = $description;
+  }
+  else {
+    $requirements['php_extensions']['value'] = $t('Enabled');
+  }
+
+  if ($phase == 'install' || $phase == 'update') {
+    // Test for PDO (database).
+    $requirements['database_extensions'] = array(
+      'title' => $t('Database support'),
+    );
+
+    // Test for at least one suitable PDO extension, if PDO is available.
+    $database_ok = extension_loaded('pdo');
+    if ($database_ok) {
+      $drivers = drupal_detect_database_types();
+      $database_ok = !empty($drivers);
+    }
+
+    if (!$database_ok) {
+      $requirements['database_extensions']['value'] = $t('Disabled');
+      $requirements['database_extensions']['severity'] = REQUIREMENT_ERROR;
+      $requirements['database_extensions']['description'] = $t('Your web server does not appear to support any common PDO database extensions. Check with your hosting provider to see if they support PDO (PHP Data Objects) and offer any databases that <a href="@drupal-databases">Drupal supports</a>.', array(
+        '@drupal-databases' => 'http://drupal.org/node/270#database',
+      ));
+    }
+    else {
+      $requirements['database_extensions']['value'] = $t('Enabled');
+    }
+  }
+
+  // Test PHP memory_limit
+  $memory_limit = ini_get('memory_limit');
+  $requirements['php_memory_limit'] = array(
+    'title' => $t('PHP memory limit'),
+    '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)) {
+    $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));
+    }
+    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));
+    }
+    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));
+    }
+
+    if (!empty($description)) {
+      if ($php_ini_path = get_cfg_var('cfg_file_path')) {
+        $description .= ' ' . $t('Increase the memory limit by editing the memory_limit parameter in the file %configuration-file and then restart your web server (or contact your system administrator or hosting provider for assistance).', array('%configuration-file' => $php_ini_path));
+      }
+      else {
+        $description .= ' ' . $t('Contact your system administrator or hosting provider for assistance with increasing your PHP memory limit.');
+      }
+
+      $requirements['php_memory_limit']['description'] = $description . ' ' . $t('See the <a href="@url">Drupal requirements</a> for more information.', array('@url' => 'http://drupal.org/requirements'));
+      $requirements['php_memory_limit']['severity'] = REQUIREMENT_WARNING;
+    }
+  }
+
+  // Test settings.php file writability
+  if ($phase == 'runtime') {
+    $conf_dir = drupal_verify_install_file(conf_path(), FILE_NOT_WRITABLE, 'dir');
+    $conf_file = drupal_verify_install_file(conf_path() . '/settings.php', FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE);
+    if (!$conf_dir || !$conf_file) {
+      $requirements['settings.php'] = array(
+        'value' => $t('Not protected'),
+        'severity' => REQUIREMENT_ERROR,
+        'description' => '',
+      );
+      if (!$conf_dir) {
+        $requirements['settings.php']['description'] .= $t('The directory %file is not protected from modifications and poses a security risk. You must change the directory\'s permissions to be non-writable. ', array('%file' => conf_path()));
+      }
+      if (!$conf_file) {
+        $requirements['settings.php']['description'] .= $t('The file %file is not protected from modifications and poses a security risk. You must change the file\'s permissions to be non-writable.', array('%file' => conf_path() . '/settings.php'));
+      }
+    }
+    else {
+      $requirements['settings.php'] = array(
+        'value' => $t('Protected'),
+      );
+    }
+    $requirements['settings.php']['title'] = $t('Configuration file');
+  }
+
+  // Report cron status.
+  if ($phase == 'runtime') {
+    // Cron warning threshold defaults to two days.
+    $threshold_warning = variable_get('cron_threshold_warning', 172800);
+    // Cron error threshold defaults to two weeks.
+    $threshold_error = variable_get('cron_threshold_error', 1209600);
+    // Cron configuration help text.
+    $help = $t('For more information, see the online handbook entry for <a href="@cron-handbook">configuring cron jobs</a>.', array('@cron-handbook' => 'http://drupal.org/cron'));
+
+    // Determine when cron last ran.
+    $cron_last = variable_get('cron_last');
+    if (!is_numeric($cron_last)) {
+      $cron_last = variable_get('install_time', 0);
+    }
+
+    // Determine severity based on time since cron last ran.
+    $severity = REQUIREMENT_OK;
+    if (REQUEST_TIME - $cron_last > $threshold_error) {
+      $severity = REQUIREMENT_ERROR;
+    }
+    elseif (REQUEST_TIME - $cron_last > $threshold_warning) {
+      $severity = REQUIREMENT_WARNING;
+    }
+
+    // Set summary and description based on values determined above.
+    $summary = $t('Last run !time ago', array('!time' => format_interval(REQUEST_TIME - $cron_last)));
+    $description = '';
+    if ($severity != REQUIREMENT_OK) {
+      $description = $t('Cron has not run recently.') . ' ' . $help;
+    }
+
+    $description .= ' ' . $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron')));
+    $description .= '<br />' . $t('To run cron from outside the site, go to <a href="!cron">!cron</a>', array('!cron' => url($base_url . '/cron.php', array('external' => TRUE, 'query' => array('cron_key' => variable_get('cron_key', 'drupal'))))));
+
+    $requirements['cron'] = array(
+      'title' => $t('Cron maintenance tasks'),
+      'severity' => $severity,
+      'value' => $summary,
+      'description' => $description
+    );
+  }
+
+  // Test files directories.
+  $directories = array(
+    variable_get('file_public_path', conf_path() . '/files'),
+    // By default no private files directory is configured. For private files
+    // to be secure the admin needs to provide a path outside the webroot.
+    variable_get('file_private_path', FALSE),
+  );
+
+  // Do not check for the temporary files directory at install time
+  // unless it has been set in settings.php. In this case the user has
+  // no alternative but to fix the directory if it is not writable.
+  if ($phase == 'install') {
+    $directories[] = variable_get('file_temporary_path', FALSE);
+  }
+  else {
+    $directories[] = variable_get('file_temporary_path', file_directory_temp());
+  }
+
+  $requirements['file system'] = array(
+    'title' => $t('File system'),
+  );
+
+  $error = '';
+  // For installer, create the directories if possible.
+  foreach ($directories as $directory) {
+    if (!$directory) {
+      continue;
+    }
+    if ($phase == 'install') {
+      file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
+    }
+    $is_writable = is_writable($directory);
+    $is_directory = is_dir($directory);
+    if (!$is_writable || !$is_directory) {
+      $description = '';
+      $requirements['file system']['value'] = $t('Not writable');
+      if (!$is_directory) {
+        $error .= $t('The directory %directory does not exist.', array('%directory' => $directory)) . ' ';
+      }
+      else {
+        $error .= $t('The directory %directory is not writable.', array('%directory' => $directory)) . ' ';
+      }
+      // The files directory requirement check is done only during install and runtime.
+      if ($phase == 'runtime') {
+        $description = $error . $t('You may need to set the correct directory at the <a href="@admin-file-system">file system settings page</a> or change the current directory\'s permissions so that it is writable.', array('@admin-file-system' => url('admin/config/media/file-system')));
+      }
+      elseif ($phase == 'install') {
+        // For the installer UI, we need different wording. 'value' will
+        // be treated as version, so provide none there.
+        $description = $error . $t('An automated attempt to create this directory failed, possibly due to a permissions problem. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see INSTALL.txt or the <a href="@handbook_url">online handbook</a>.', array('@handbook_url' => 'http://drupal.org/server-permissions'));
+        $requirements['file system']['value'] = '';
+      }
+      if (!empty($description)) {
+        $requirements['file system']['description'] = $description;
+        $requirements['file system']['severity'] = REQUIREMENT_ERROR;
+      }
+    }
+    else {
+      if (file_default_scheme() == 'public') {
+        $requirements['file system']['value'] = $t('Writable (<em>public</em> download method)');
+      }
+      else {
+        $requirements['file system']['value'] = $t('Writable (<em>private</em> download method)');
+      }
+    }
+  }
+
+  // See if updates are available in update.php.
+  if ($phase == 'runtime') {
+    $requirements['update'] = array(
+      'title' => $t('Database updates'),
+      'severity' => REQUIREMENT_OK,
+      'value' => $t('Up to date'),
+    );
+
+    // Check installed modules.
+    foreach (module_list() as $module) {
+      $updates = drupal_get_schema_versions($module);
+      if ($updates !== FALSE) {
+        $default = drupal_get_installed_schema_version($module);
+        if (max($updates) > $default) {
+          $requirements['update']['severity'] = REQUIREMENT_ERROR;
+          $requirements['update']['value'] = $t('Out of date');
+          $requirements['update']['description'] = $t('Some modules have database schema updates to install. You should run the <a href="@update">database update script</a> immediately.', array('@update' => base_path() . 'update.php'));
+          break;
+        }
+      }
+    }
+  }
+
+  // Verify the update.php access setting
+  if ($phase == 'runtime') {
+    if (!empty($GLOBALS['update_free_access'])) {
+      $requirements['update access'] = array(
+        'value' => $t('Not protected'),
+        'severity' => REQUIREMENT_ERROR,
+        'description' => $t('The update.php script is accessible to everyone without authentication check, which is a security risk. You must change the $update_free_access value in your settings.php back to FALSE.'),
+      );
+    }
+    else {
+      $requirements['update access'] = array(
+        'value' => $t('Protected'),
+      );
+    }
+    $requirements['update access']['title'] = $t('Access to update.php');
+  }
+
+  // Display an error if a newly introduced dependency in a module is not resolved.
+  if ($phase == 'update') {
+    $profile = drupal_get_profile();
+    $files = system_rebuild_module_data();
+    foreach ($files as $module => $file) {
+      // Ignore disabled modules and install profiles.
+      if (!$file->status || $module == $profile) {
+        continue;
+      }
+      // Check the module's PHP version.
+      $name = $file->info['name'];
+      $php = $file->info['php'];
+      if (version_compare($php, PHP_VERSION, '>')) {
+        $requirements['php']['description'] .= $t('@name requires at least PHP @version.', array('@name' => $name, '@version' => $php));
+        $requirements['php']['severity'] = REQUIREMENT_ERROR;
+      }
+      // Check the module's required modules.
+      foreach ($file->requires as $requirement) {
+        $required_module = $requirement['name'];
+        // Check if the module exists.
+        if (!isset($files[$required_module])) {
+          $requirements["$module-$required_module"] = array(
+            'title' => $t('Unresolved dependency'),
+            'description' => $t('@name requires this module.', array('@name' => $name)),
+            'value' => t('@required_name (Missing)', array('@required_name' => $required_module)),
+            'severity' => REQUIREMENT_ERROR,
+          );
+          continue;
+        }
+        // Check for an incompatible version.
+        $required_file = $files[$required_module];
+        $required_name = $required_file->info['name'];
+        $version = str_replace(DRUPAL_CORE_COMPATIBILITY . '-', '', $required_file->info['version']);
+        $compatibility = drupal_check_incompatibility($requirement, $version);
+        if ($compatibility) {
+          $compatibility = rtrim(substr($compatibility, 2), ')');
+          $requirements["$module-$required_module"] = array(
+            'title' => $t('Unresolved dependency'),
+            'description' => $t('@name requires this module and version. Currently using @required_name version @version', array('@name' => $name, '@required_name' => $required_name, '@version' => $version)),
+            'value' => t('@required_name (Version @compatibility required)', array('@required_name' => $required_name, '@compatibility' => $compatibility)),
+            'severity' => REQUIREMENT_ERROR,
+          );
+          continue;
+        }
+      }
+    }
+  }
+
+  // Test Unicode library
+  include_once DRUPAL_ROOT . '/includes/unicode.inc';
+  $requirements = array_merge($requirements, unicode_requirements());
+
+  if ($phase == 'runtime') {
+    // Check for update status module.
+    if (!module_exists('update')) {
+      $requirements['update status'] = array(
+        'value' => $t('Not enabled'),
+        'severity' => REQUIREMENT_WARNING,
+        'description' => $t('Update notifications are not enabled. It is <strong>highly recommended</strong> that you enable the update status module from the <a href="@module">module administration page</a> in order to stay up-to-date on new releases. For more information, <a href="@update">Update status handbook page</a>.', array('@update' => 'http://drupal.org/handbook/modules/update', '@module' => url('admin/modules'))),
+      );
+    }
+    else {
+      $requirements['update status'] = array(
+        'value' => $t('Enabled'),
+      );
+    }
+    $requirements['update status']['title'] = $t('Update notifications');
+
+    // Check that Drupal can issue HTTP requests.
+    if (variable_get('drupal_http_request_fails', TRUE) && !system_check_http_request()) {
+      $requirements['http requests'] = array(
+        'title' => $t('HTTP request status'),
+        'value' => $t('Fails'),
+        'severity' => REQUIREMENT_ERROR,
+        'description' => $t('Your system or network configuration does not allow Drupal to access web pages, resulting in reduced functionality. This could be due to your webserver configuration or PHP settings, and should be resolved in order to download information about available updates, fetch aggregator feeds, sign in via OpenID, or use other network-dependent services. If you are certain that Drupal can access web pages but you are still seeing this message, you may add <code>$conf[\'drupal_http_request_fails\'] = FALSE;</code> to the bottom of your settings.php file.'),
+      );
+    }
+  }
 
-  $schema['sequences'] = array(
-    'description' => 'Stores IDs.',
-    'fields' => array(
-      'value' => array(
-        'description' => 'The value of the sequence.',
-        'type' => 'serial',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-      ),
-     ),
-    'primary key' => array('value'),
-  );
+  return $requirements;
+}
 
-  $schema['sessions'] = array(
-    'description' => "Drupal's session handlers read and write into the sessions table. Each record represents a user session, either anonymous or authenticated.",
-    'fields' => array(
-      'uid' => array(
-        'description' => 'The {users}.uid corresponding to a session, or 0 for anonymous user.',
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-      ),
-      'sid' => array(
-        'description' => "A session ID. The value is generated by PHP's Session API.",
-        'type' => 'varchar',
-        'length' => 128,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'ssid' => array(
-        'description' => "Secure session ID. The value is generated by PHP's Session API.",
-        'type' => 'varchar',
-        'length' => 128,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'hostname' => array(
-        'description' => 'The IP address that last used this session ID (sid).',
-        'type' => 'varchar',
-        'length' => 128,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'timestamp' => array(
-        'description' => 'The Unix timestamp when this session last requested a page. Old records are purged by PHP automatically.',
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'cache' => array(
-        'description' => "The time of this user's last post. This is used when the site has specified a minimum_cache_lifetime. See cache_get().",
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'session' => array(
-        'description' => 'The serialized contents of $_SESSION, an array of name/value pairs that persists across page requests by this session ID. Drupal loads $_SESSION from here at the start of each request and saves it at the end.',
-        'type' => 'blob',
-        'not null' => FALSE,
-        'size' => 'big',
-      ),
-    ),
-    'primary key' => array(
-      'sid',
-      'ssid',
-    ),
-    'indexes' => array(
-      'timestamp' => array('timestamp'),
-      'uid' => array('uid'),
-      'ssid' => array('ssid'),
-    ),
-    'foreign keys' => array(
-      'session_user' => array(
-        'table' => 'users',
-        'columns' => array('uid' => 'uid'),
-      ),
-    ),
-  );
+/**
+ * Implements hook_install().
+ */
+function system_install() {
+  // Create tables.
+  drupal_install_schema('system');
+  $versions = drupal_get_schema_versions('system');
+  $version = $versions ? max($versions) : SCHEMA_INSTALLED;
+  drupal_set_installed_schema_version('system', $version);
 
-  $schema['system'] = array(
-    'description' => "A list of all modules, themes, and theme engines that are or have been installed in Drupal's file system.",
-    'fields' => array(
-      'filename' => array(
-        'description' => 'The path of the primary file for this item, relative to the Drupal root; e.g. modules/node/node.module.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'name' => array(
-        'description' => 'The name of the item; e.g. node.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'type' => array(
-        'description' => 'The type of the item, either module, theme, theme_engine, or profile.',
-        'type' => 'varchar',
-        'length' => 12,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'owner' => array(
-        'description' => "A theme's 'parent' . Can be either a theme or an engine.",
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'status' => array(
-        'description' => 'Boolean indicating whether or not this item is enabled.',
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'bootstrap' => array(
-        'description' => "Boolean indicating whether this module is loaded during Drupal's early bootstrapping phase (e.g. even before the page cache is consulted).",
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'schema_version' => array(
-        'description' => "The module's database schema version number. -1 if the module is not installed (its tables do not exist); 0 or the largest N of the module's hook_update_N() function that has either been run or existed when the module was first installed.",
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => -1,
-        'size' => 'small',
-      ),
-      'weight' => array(
-        'description' => "The order in which this module's hooks should be invoked relative to other modules. Equal-weighted modules are ordered by name.",
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'info' => array(
-        'description' => "A serialized array containing information from the module's .info file; keys can include name, description, package, version, core, dependencies, and php.",
-        'type' => 'blob',
-        'not null' => FALSE,
-      ),
-    ),
-    'primary key' => array('filename'),
-    'indexes' => array(
-      'system_list' => array('status', 'bootstrap', 'type', 'weight', 'name'),
-      'type_name' => array('type', 'name'),
-    ),
-  );
+  // Clear out module list and hook implementation statics before calling
+  // system_rebuild_theme_data().
+  module_list(TRUE);
+  module_implements('', FALSE, TRUE);
 
-  $schema['url_alias'] = array(
-    'description' => 'A list of URL aliases for Drupal paths; a user may visit either the source or destination path.',
-    'fields' => array(
-      'pid' => array(
-        'description' => 'A unique path alias identifier.',
-        'type' => 'serial',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-      ),
-      'source' => array(
-        'description' => 'The Drupal path this alias is for; e.g. node/12.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'alias' => array(
-        'description' => 'The alias for this path; e.g. title-of-the-story.',
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-      'language' => array(
-        'description' => 'The language this alias is for; if blank, the alias will be used for unknown languages. Each Drupal path can have an alias for each supported language.',
-        'type' => 'varchar',
-        'length' => 12,
-        'not null' => TRUE,
-        'default' => '',
-      ),
-    ),
-    'primary key' => array('pid'),
-    'indexes' => array(
-      'alias_language_pid' => array('alias', 'language', 'pid'),
-      'source_language_pid' => array('source', 'language', 'pid'),
-    ),
-  );
+  // Load system theme data appropriately.
+  system_rebuild_theme_data();
 
-  return $schema;
+  // Enable the default theme.
+  variable_set('theme_default', 'bartik');
+  db_update('system')
+    ->fields(array('status' => 1))
+    ->condition('type', 'theme')
+    ->condition('name', 'bartik')
+    ->execute();
+
+  // Populate the cron key variable.
+  $cron_key = drupal_hash_base64(drupal_random_bytes(55));
+  variable_set('cron_key', $cron_key);
 }
 
 /**
Index: modules/taxonomy/taxonomy.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.install,v
retrieving revision 1.50
diff -u -p -r1.50 taxonomy.install
--- modules/taxonomy/taxonomy.install	4 Oct 2010 14:51:16 -0000	1.50
+++ modules/taxonomy/taxonomy.install	5 Oct 2010 04:42:55 -0000
@@ -7,15 +7,6 @@
  */
 
 /**
- * Implements hook_uninstall().
- */
-function taxonomy_uninstall() {
-  // Remove variables.
-  variable_del('taxonomy_override_selector');
-  variable_del('taxonomy_terms_per_page_admin');
-}
-
-/**
  * Implements hook_schema().
  */
 function taxonomy_schema() {
@@ -239,6 +230,15 @@ function taxonomy_field_schema($field) {
 }
 
 /**
+ * Implements hook_uninstall().
+ */
+function taxonomy_uninstall() {
+  // Remove variables.
+  variable_del('taxonomy_override_selector');
+  variable_del('taxonomy_terms_per_page_admin');
+}
+
+/**
  * Implements hook_update_dependencies().
  */
 function taxonomy_update_dependencies() {
Index: modules/update/update.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/update/update.install,v
retrieving revision 1.20
diff -u -p -r1.20 update.install
--- modules/update/update.install	3 Oct 2010 22:44:48 -0000	1.20
+++ modules/update/update.install	5 Oct 2010 04:42:55 -0000
@@ -7,6 +7,15 @@
  */
 
 /**
+ * Implements hook_schema().
+ */
+function update_schema() {
+  $schema['cache_update'] = drupal_get_schema_unprocessed('system', 'cache');
+  $schema['cache_update']['description'] = 'Cache table for the Update module to store information about available releases, fetched from central server.';
+  return $schema;
+}
+
+/**
  * Implements hook_requirements().
  *
  * @return
@@ -59,15 +68,6 @@ function update_requirements($phase) {
 }
 
 /**
- * Implements hook_schema().
- */
-function update_schema() {
-  $schema['cache_update'] = drupal_get_schema_unprocessed('system', 'cache');
-  $schema['cache_update']['description'] = 'Cache table for the Update module to store information about available releases, fetched from central server.';
-  return $schema;
-}
-
-/**
  * Implements hook_install().
  */
 function update_install() {
