From 3c07d94a471681049f4fc853fc30850f9f3aec4a Mon Sep 17 00:00:00 2001 From: Git Date: Sat, 3 May 2014 08:01:07 +0000 Subject: [PATCH] Empty commit --- classes/cache.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/classes/cache.class.php b/classes/cache.class.php index b671e19d..77da0f5a 100644 --- a/classes/cache.class.php +++ b/classes/cache.class.php @@ -83,6 +83,9 @@ public function cache_value($Key, $Value, $Duration = 2592000) { if (!$this->set($Key, $Value, 0, $Duration)) { trigger_error("Cache insert failed for key $Key"); } + if (array_key_exists($Key, $this->CacheHits)) { + $this->CacheHits[$Key] = $Value; + } $this->Time += (microtime(true) - $StartTime) * 1000; } @@ -97,6 +100,9 @@ public function add_value($Key, $Value, $Duration = 2592000) { public function replace_value($Key, $Value, $Duration = 2592000) { $StartTime = microtime(true); $this->replace($Key, $Value, false, $Duration); + if (array_key_exists($Key, $this->CacheHits)) { + $this->CacheHits[$Key] = $Value; + } $this->Time += (microtime(true) - $StartTime) * 1000; } @@ -163,12 +169,16 @@ public function delete_value($Key) { if (!$this->delete($Key)) { //trigger_error("Cache delete failed for key $Key"); } + unset($this->CacheHits[$Key]); $this->Time += (microtime(true) - $StartTime) * 1000; } public function increment_value($Key, $Value = 1) { $StartTime = microtime(true); - $this->increment($Key, $Value); + $NewVal = $this->increment($Key, $Value); + if (isset($this->CacheHits[$Key])) { + $this->CacheHits[$Key] = $NewVal; + } $this->Time += (microtime(true) - $StartTime) * 1000; }