Skip to content

Commit

Permalink
Making cache tags more efficient by rewriting the API.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm committed Feb 23, 2016
1 parent 913f0bc commit 52376fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 45 deletions.
8 changes: 4 additions & 4 deletions MemcacheCachePool.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(Memcache $cache)
protected function fetchObjectFromCache($key)
{
if (false === $result = unserialize($this->cache->get($key))) {
return [false, null];
return [false, null, []];
}

return $result;
Expand All @@ -48,10 +48,10 @@ protected function clearOneObjectFromCache($key)
return true;
}

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

return $this->cache->set($key, $data, 0, $ttl ?: 0);
return $this->cache->set($item->getKey(), $data, 0, $ttl ?: 0);
}
}
40 changes: 0 additions & 40 deletions Tests/IntegrationTagTest.php

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"require-dev": {
"phpunit/phpunit": "^4.0|^5.1",
"cache/integration-tests": "0.7.0"
"cache/integration-tests": "0.9.0"
},
"provide": {
"psr/cache-implementation": "^1.0"
Expand Down

0 comments on commit 52376fc

Please sign in to comment.