summaryrefslogtreecommitdiff
path: root/it_cache.class
diff options
context:
space:
mode:
authorUrban Müller2025-10-10 17:58:02 +0200
committerUrban Müller2025-10-10 18:21:04 +0200
commitaef9268f09a332d56d6f0a7136eb20084a6bd32a (patch)
tree286059a5d5aac9401f8c81a0b65e3fb15c3f2160 /it_cache.class
parent9e39eb43ebefca7dd26a65e2a3dd6aa366ec337c (diff)
downloaditools-aef9268f09a332d56d6f0a7136eb20084a6bd32a.tar.gz
itools-aef9268f09a332d56d6f0a7136eb20084a6bd32a.tar.bz2
itools-aef9268f09a332d56d6f0a7136eb20084a6bd32a.zip
remove global variable
Diffstat (limited to 'it_cache.class')
-rw-r--r--it_cache.class7
1 files changed, 4 insertions, 3 deletions
diff --git a/it_cache.class b/it_cache.class
index 081db65..62c151d 100644
--- a/it_cache.class
+++ b/it_cache.class
@@ -23,6 +23,7 @@ class it_cache
{
static $_fetch_func;
static $_store_func;
+ static $_local = [];
static function _defaults($p)
{
@@ -45,10 +46,10 @@ static function get($key, $p = array())
{
$p = it_cache::_defaults($p);
- if (isset($GLOBALS['it_cache_local'][$key]))
+ if (isset(it_cache::$_local[$key]))
{
# Use local copy
- $result = $GLOBALS['it_cache_local'][$key];
+ $result = it_cache::$_local[$key];
$success = true;
}
else if ($p['distributed'] && ($memcache = it_cache::_get_memcache($p)))
@@ -92,7 +93,7 @@ static function put($key, $value, $p = array())
'blockmail' => $memcache? 12*3600 : null,
]));
- $GLOBALS['it_cache_local'][$key] = $value; # Also store local copy
+ it_cache::$_local[$key] = $value; # Also store local copy
return $value;
}