From d1aa59b6fde90c991bf7938fabfd840d0d0d89ed Mon Sep 17 00:00:00 2001
From: Katherine Bailey <katherine@katbailey.net>
Date: Sat, 2 Apr 2011 00:40:08 -0700
Subject: [PATCH] switching to using drupal_static

---
 flag.module |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git flag.module flag.module
index a4a9fdf..9e2e0db 100644
--- flag.module
+++ flag.module
@@ -1214,7 +1214,7 @@ function flag_theme() {
  */
 function template_preprocess_flag(&$variables) {
   global $user;
-  static $initialized = array();
+  $initialized = &drupal_static(__FUNCTION__);
 
   // Some typing shotcuts:
   $flag =& $variables['flag'];
@@ -1348,7 +1348,7 @@ function _flag_link_type_fields() {
  *   An array of the structure [name] => [number of flags].
  */
 function flag_get_counts($content_type, $content_id, $reset = FALSE) {
-  static $counts;
+  $counts = &drupal_static(__FUNCTION__);
 
   if ($reset) {
     $counts = array();
@@ -1384,7 +1384,7 @@ function flag_get_counts($content_type, $content_id, $reset = FALSE) {
  *   Reset the internal cache and execute the SQL query another time.
  */
 function flag_get_flag_counts($flag_name, $reset = FALSE) {
-  static $counts;
+  $counts = &drupal_static(__FUNCTION__);
 
   if ($reset) {
     $counts = array();
@@ -1443,7 +1443,7 @@ function flag_get_flag($name = NULL, $fid = NULL) {
  *   An array of the structure [fid] = flag_object.
  */
 function flag_get_flags($content_type = NULL, $content_subtype = NULL, $account = NULL, $reset = FALSE) {
-  static $flags;
+  $flags = &drupal_static(__FUNCTION__);
 
   // Retrieve a list of all flags, regardless of the parameters.
   if (!isset($flags) || $reset) {
@@ -1643,7 +1643,7 @@ function flag_get_content_id($fcid) {
  *
  */
 function flag_get_user_flags($content_type, $content_id = NULL, $uid = NULL, $sid = NULL, $reset = FALSE) {
-  static $flagged_content;
+  $flagged_content = &drupal_static(__FUNCTION__);
 
   if ($reset) {
     $flagged_content = array();
@@ -1717,7 +1717,7 @@ function flag_get_user_flags($content_type, $content_id = NULL, $uid = NULL, $si
  *   a flag name is specified, only the information for that flag is returned.
  */
 function flag_get_content_flags($content_type, $content_id, $flag_name = NULL, $reset = FALSE) {
-  static $content_flags;
+  $content_flags = &drupal_static(__FUNCTION__);
 
   if (!isset($content_flags[$content_type][$content_id]) || $reset) {
     $flag_names = _flag_get_flag_names();
@@ -1769,7 +1769,7 @@ function flag_create_link($flag_name, $content_id) {
  * Return an array of link types provided by modules.
  */
 function flag_get_link_types($reset = FALSE) {
-  static $link_types;
+  $link_types = &drupal_static(__FUNCTION__);
 
   if (!isset($link_types) || $reset) {
     $link_types = array();
@@ -1816,7 +1816,7 @@ function flag_check_token($token, $content_id) {
  * SID in case the user logs in during this request.
  */
 function flag_set_sid($uid = NULL) {
-  static $sids = array();
+  $sids = &drupal_static(__FUNCTION__);
 
   if (!isset($uid)) {
     $uid = $GLOBALS['user']->uid;
-- 
1.7.4.1

