Skip to content

Commit

Permalink
Tagging bugfix and updated tests to ^0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm committed Feb 25, 2016
1 parent b877e64 commit c522307
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions MemcachedCachePool.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public function __construct(\Memcached $cache)
$this->cache->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);
}

/**
* {@inheritdoc}
*/
protected function fetchObjectFromCache($key)
{
if (false === $result = unserialize($this->cache->get($this->getHierarchyKey($key)))) {
Expand All @@ -47,11 +50,17 @@ protected function fetchObjectFromCache($key)
return $result;
}

/**
* {@inheritdoc}
*/
protected function clearAllObjectsFromCache()
{
return $this->cache->flush();
}

/**
* {@inheritdoc}
*/
protected function clearOneObjectFromCache($key)
{
$this->commit();
Expand All @@ -67,6 +76,9 @@ protected function clearOneObjectFromCache($key)
return $this->cache->getResultCode() === \Memcached::RES_NOTFOUND;
}

/**
* {@inheritdoc}
*/
protected function storeItemInCache(CacheItemInterface $item, $ttl)
{
if ($ttl === null) {
Expand All @@ -80,6 +92,9 @@ protected function storeItemInCache(CacheItemInterface $item, $ttl)
return $this->cache->set($key, serialize([true, $item->get(), []]), $ttl);
}

/**
* {@inheritdoc}
*/
protected function getValueFormStore($key)
{
return $this->cache->get($key);
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
"php": "^5.5|^7.0",
"ext-memcached": "*",
"psr/cache": "^1.0",
"cache/adapter-common": "^0.2",
"cache/taggable-cache": "^0.3",
"cache/adapter-common": "^0.3",
"cache/taggable-cache": "^0.4",
"cache/hierarchical-cache": "^0.2"
},
"require-dev": {
"phpunit/phpunit": "^4.0|^5.1",
"cache/integration-tests": "0.9.0"
"cache/integration-tests": "^0.9"
},
"provide": {
"psr/cache-implementation": "^1.0"
Expand Down

0 comments on commit c522307

Please sign in to comment.