Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.440
diff -u -p -r1.440 bootstrap.inc
--- includes/bootstrap.inc	14 Nov 2010 00:21:13 -0000	1.440
+++ includes/bootstrap.inc	18 Nov 2010 02:52:44 -0000
@@ -760,20 +760,32 @@ function variable_initialize($conf = arr
  * variable names.
  *
  * @param $name
- *   The name of the variable to return.
+ *   The name of the variable to return - OR -
+ *   an array of variable name => default value pairs.
  * @param $default
  *   The default value to use if this variable has never been set.
  *
  * @return
- *   The value of the variable.
+ *   The value of the variable - OR - if passing an array - an
+ *   array of variable name => value pairs.
  *
  * @see variable_del()
  * @see variable_set()
  */
 function variable_get($name, $default = NULL) {
   global $conf;
+  
+  //We have been passed a standard variable, return single value now
+  if (!is_array($name)) {
+    return isset($conf[$name]) ? $conf[$name] : $default;
+  }
+  $values = array();
+  $variables = $name;
 
-  return isset($conf[$name]) ? $conf[$name] : $default;
+  foreach ($variables as $name => $default) {
+    $values[$name] = isset($conf[$name]) ? $conf[$name] : $default;
+  }
+  return $values;
 }
 
 /**
@@ -784,22 +796,32 @@ function variable_get($name, $default = 
  * variable names.
  *
  * @param $name
- *   The name of the variable to set.
+ *   The name of the variable to set (string) - OR -
+ *   an array of variable name => value pairs.
  * @param $value
  *   The value to set. This can be any PHP data type; these functions take care
  *   of serialization as necessary.
+ *   If using the array format, not required
  *
  * @see variable_del()
  * @see variable_get()
  */
-function variable_set($name, $value) {
+function variable_set($name, $value = NULL) {
   global $conf;
 
-  db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute();
+  $variables = $name;
+  //We have been passed a standard variable, convert to array for consistency
+  if (!is_array($variables)) {
+    $variables = array($name => $value);
+  }
+
+  foreach ($variables as $name => $value) {
+    db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute();
+    $conf[$name] = $value;
+  }
 
   cache_clear_all('variables', 'cache_bootstrap');
 
-  $conf[$name] = $value;
 }
 
 /**
@@ -810,7 +832,8 @@ function variable_set($name, $value) {
  * variable names.
  *
  * @param $name
- *   The name of the variable to undefine.
+ *   The name of the variable to undefine (string) - OR -
+ *   an array of variable names.
  *
  * @see variable_get()
  * @see variable_set()
@@ -818,12 +841,20 @@ function variable_set($name, $value) {
 function variable_del($name) {
   global $conf;
 
-  db_delete('variable')
-    ->condition('name', $name)
-    ->execute();
+  $variables = $name;
+  //We have been passed a standard variable, convert to array for consistency
+  if (!is_array($variables)) {
+    $variables = array($name);
+  }
+
+  foreach ($variables as $name) {
+    db_delete('variable')
+      ->condition('name', $name)
+      ->execute();
+    unset($conf[$name]);
+  }
   cache_clear_all('variables', 'cache_bootstrap');
 
-  unset($conf[$name]);
 }
 
 /**
Index: modules/simpletest/tests/bootstrap.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/bootstrap.test,v
retrieving revision 1.33
diff -u -p -r1.33 bootstrap.test
--- modules/simpletest/tests/bootstrap.test	5 Aug 2010 23:53:38 -0000	1.33
+++ modules/simpletest/tests/bootstrap.test	18 Nov 2010 02:52:46 -0000
@@ -255,6 +255,34 @@ class BootstrapVariableTestCase extends 
     variable_del('simpletest_bootstrap_variable_test');
     $variable = variable_get('simpletest_bootstrap_variable_test', $default_value);
     $this->assertIdentical($variable, $default_value, t('Deleting variables'));
+    
+    //Setting and retrieving values (array format).
+    $variable_1 = $this->randomName();
+    $variable_2 = $this->randomName();
+    $variables = array(
+      'simpletest_bootstrap_variable_test_1' => $variable_1,
+      'simpletest_bootstrap_variable_test_2' => $variable_2,
+    );
+    variable_set($variables);
+    $variable_get = variable_get(array('simpletest_bootstrap_variable_test1' => NULL,
+                                       'simpletest_bootstrap_variable_test2' => NULL));
+    $this->assertIdentical($variable, $variable_get, t('Setting and retrieving values as array'));
+    
+    // Make sure the variables persists across multiple requests.
+    $this->drupalGet('system-test/variable-get-array');
+    $this->assertText(print_r($variables, TRUE), t('Variables set as arrays persist across multiple requests'));
+    
+    // Deleting variables.
+    $default_value_1 = $this->randomName();
+    $default_value_2 = $this->randomName();
+    $variables = array(
+      'simpletest_bootstrap_variable_test_1' => $default_value_1,
+      'simpletest_bootstrap_variable_test_2' => $default_value_2,
+    );
+    variable_del(array('simpletest_bootstrap_variable_test_1', 'simpletest_bootstrap_variable_test_2'));
+    $variable_get = variable_get($variables);
+    $this->assertIdentical($variables, $variable_get, t('Deleting variables as array'));
+    
   }
 
   /**
Index: modules/simpletest/tests/system_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/system_test.module,v
retrieving revision 1.32
diff -u -p -r1.32 system_test.module
--- modules/simpletest/tests/system_test.module	1 Aug 2010 23:35:01 -0000	1.32
+++ modules/simpletest/tests/system_test.module	18 Nov 2010 02:52:46 -0000
@@ -51,6 +51,13 @@ function system_test_menu() {
     'access arguments' => array('access content'),
     'type' => MENU_CALLBACK,
   );
+  
+  $items['system-test/variable-get-array'] = array(
+    'title' => 'Variable Get',
+    'page callback' => 'system_test_variable_get_array',
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+  );
 
   $items['system-test/lock-acquire'] = array(
     'title' => 'Lock acquire',
@@ -311,3 +318,11 @@ function _system_test_second_shutdown_fu
   throw new Exception('Drupal is <blink>awesome</blink>.');
 }
 
+/**
+ * Menu callback to test variable get with an array
+*/
+function system_test_variable_get_array() {
+  $variables = array('simpletest_bootstrap_variable_test_1' => NULL,
+                     'simpletest_bootstrap_variable_test_2' => NULL);
+  return print_r(variable_get($variables), TRUE);
+}
\ No newline at end of file
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.989
diff -u -p -r1.989 system.module
--- modules/system/system.module	15 Nov 2010 17:47:50 -0000	1.989
+++ modules/system/system.module	18 Nov 2010 02:52:49 -0000
@@ -2698,12 +2698,15 @@ function system_settings_form_submit($fo
   // Exclude unnecessary elements.
   form_state_values_clean($form_state);
 
+  $values = array();
   foreach ($form_state['values'] as $key => $value) {
     if (is_array($value) && isset($form_state['values']['array_filter'])) {
       $value = array_keys(array_filter($value));
     }
-    variable_set($key, $value);
+    $values[$key] = $value;
   }
+  //we use the array form of variable_set
+  variable_set($values);
 
   drupal_set_message(t('The configuration options have been saved.'));
 }
