Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Fixed issue where Cache::forget() works differently if keys created with Cache::flexible when using Redis, DynamoDB, Memcached or Apc #52936

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Illuminate/Cache/ApcStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ public function forever($key, $value)
*/
public function forget($key)
{
$this->apc->delete("{$this->prefix}illuminate:cache:flexible:created:{$key}");

return $this->apc->delete($this->prefix.$key);
}

Expand Down
9 changes: 9 additions & 0 deletions src/Illuminate/Cache/DynamoDbStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,15 @@ public function restoreLock($name, $owner)
*/
public function forget($key)
{
$this->dynamo->deleteItem([
'TableName' => $this->table,
'Key' => [
$this->keyAttribute => [
'S' => "{$this->prefix}illuminate:cache:flexible:created:{$key}",
],
],
]);

$this->dynamo->deleteItem([
'TableName' => $this->table,
'Key' => [
Expand Down
2 changes: 2 additions & 0 deletions src/Illuminate/Cache/MemcachedStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ public function restoreLock($name, $owner)
*/
public function forget($key)
{
$this->memcached->delete("{$this->prefix}illuminate:cache:flexible:created:{$key}");

return $this->memcached->delete($this->prefix.$key);
}

Expand Down
2 changes: 2 additions & 0 deletions src/Illuminate/Cache/RedisStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ public function restoreLock($name, $owner)
*/
public function forget($key)
{
$this->connection()->del("{$this->prefix}illuminate:cache:flexible:created:{$key}");

return (bool) $this->connection()->del($this->prefix.$key);
}

Expand Down
Loading