? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.464
diff -u -p -r1.464 bootstrap.inc
--- includes/bootstrap.inc	13 Jan 2011 01:04:13 -0000	1.464
+++ includes/bootstrap.inc	22 Jan 2011 02:38:35 -0000
@@ -806,7 +806,11 @@ function variable_set($name, $value) {
 
   cache_clear_all('variables', 'cache_bootstrap');
 
+  $old_value = array_key_exists($name, $conf) ? $conf[$name] : NULL;
+
   $conf[$name] = $value;
+
+  module_invoke_all('variable_set', $name, $value, $old_value);
 }
 
 /**
@@ -831,6 +835,8 @@ function variable_del($name) {
   cache_clear_all('variables', 'cache_bootstrap');
 
   unset($conf[$name]);
+
+  module_invoke_all('variable_del', $name);
 }
 
 /**
Index: modules/system/system.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v
retrieving revision 1.226
diff -u -p -r1.226 system.api.php
--- modules/system/system.api.php	11 Jan 2011 13:40:06 -0000	1.226
+++ modules/system/system.api.php	22 Jan 2011 02:38:42 -0000
@@ -1883,6 +1883,34 @@ function hook_system_info_alter(&$info, 
 }
 
 /**
+ * Allow modules to react to changes in a variable.
+ *
+ * @param mixed $name
+ *   The name of the variable.
+ * @param mixed $value
+ *   The value the variable is being set to.
+ * @param mixed $old_value
+ *   The old value of the variable.
+ */
+function hook_variable_set($name, $value, $old_value = NULL) {
+  if ($name == 'mymodule_foo') {
+    mymodule_notify_variable_change($name, $value, $old_value);
+  }
+}
+
+/**
+ * Allow modules to react to a variable deletion.
+ *
+ * @param mixed $name
+ *   The name of the variable.
+ */
+function hook_variable_del($name) {
+  if ($name == 'mymodule_foo') {
+    mymodule_notify_variable_del($name);
+  }
+}
+
+/**
  * Define user permissions.
  *
  * This hook can supply permissions that the module defines, so that they
