Skip to content

Commit 52376fc

Browse files
committed
Making cache tags more efficient by rewriting the API.
Related to php-cache/issues#21
1 parent 913f0bc commit 52376fc

File tree

3 files changed

+5
-45
lines changed

3 files changed

+5
-45
lines changed

MemcacheCachePool.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(Memcache $cache)
3030
protected function fetchObjectFromCache($key)
3131
{
3232
if (false === $result = unserialize($this->cache->get($key))) {
33-
return [false, null];
33+
return [false, null, []];
3434
}
3535

3636
return $result;
@@ -48,10 +48,10 @@ protected function clearOneObjectFromCache($key)
4848
return true;
4949
}
5050

51-
protected function storeItemInCache($key, CacheItemInterface $item, $ttl)
51+
protected function storeItemInCache(CacheItemInterface $item, $ttl)
5252
{
53-
$data = serialize([true, $item->get()]);
53+
$data = serialize([true, $item->get(), []]);
5454

55-
return $this->cache->set($key, $data, 0, $ttl ?: 0);
55+
return $this->cache->set($item->getKey(), $data, 0, $ttl ?: 0);
5656
}
5757
}

Tests/IntegrationTagTest.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"require-dev": {
3434
"phpunit/phpunit": "^4.0|^5.1",
35-
"cache/integration-tests": "0.7.0"
35+
"cache/integration-tests": "0.9.0"
3636
},
3737
"provide": {
3838
"psr/cache-implementation": "^1.0"

0 commit comments

Comments
 (0)