? 422352-improve_static_cache_comments.patch
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	14 Feb 2011 20:33:06 -0000
@@ -2757,6 +2757,16 @@ function registry_update() {
  * }
  * @endcode
  *
+ * In cases where drupal_static needs to be called from a singleton class, the naming
+ * scheme "__CLASS__ . '::' . __METHOD__" should be used in substitute for __FUNCTION__.
+ *
+ * Should more than one variable need caching, append the variable to the function or method
+ * with ':'.
+ * Example
+ * @code
+ * $some_var = &drupal_static(__FUNCTION__ . ':some_var');
+ * @endcode
+ *
  * In a few cases, a function can have certainty that there is no legitimate
  * use-case for resetting that function's static variable. This is rare,
  * because when writing a function, it's hard to forecast all the situations in
@@ -2874,6 +2884,8 @@ function &drupal_static($name, $default_
  *
  * @param $name
  *   Name of the static variable to reset. Omit to reset all variables.
+ *   This should rarely, if ever, be omitted.  It is only for extreme cases
+ *   where all data is being reset, such as with simpletest.
  */
 function drupal_static_reset($name = NULL) {
   drupal_static($name, NULL, TRUE);
