From b8ce6b38fdd96b38ea16e3b2c46820a8b4c0c58a Mon Sep 17 00:00:00 2001 From: janua bisconti Date: Fri, 20 Dec 2024 15:34:39 +0100 Subject: [PATCH] fix forget --- src/SuperCacheManager.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SuperCacheManager.php b/src/SuperCacheManager.php index 660c116..4d3466f 100644 --- a/src/SuperCacheManager.php +++ b/src/SuperCacheManager.php @@ -167,7 +167,7 @@ public function get(string $key, ?string $connection_name = null, bool $isWithTa public function forget(string $key, ?string $connection_name = null, bool $isFinalKey = false, bool $isWithTags = false, bool $onlyTags = false): void { if ($isFinalKey) { - $finalKey = $key; + $finalKey = str_replace(['{', '}'], '', $key); } else { $finalKey = $this->getFinalKey($key, $isWithTags); } @@ -292,12 +292,12 @@ public function flush(?string $connection_name = null): void public function has(string $key, ?string $connection_name = null, bool $isWithTags = false, bool $isfinalKey = false): bool { if ($isfinalKey) { - $finalKey = $key; + $finalKey = str_replace(['{', '}'], '', $key); } else { - $finalKey = '{' . $this->getFinalKey($key, $isWithTags) . '}'; + $finalKey = $this->getFinalKey($key, $isWithTags); } - return $this->redis->getRedisConnection($connection_name)->exists($finalKey) > 0; + return $this->redis->getRedisConnection($connection_name)->exists('{' . $finalKey . '}') > 0; } /**