Refactor Cache services

This commit is contained in:
Romain Neutron
2012-02-21 16:49:54 +01:00
parent 2c0a3f619f
commit c91a84937c
13 changed files with 484 additions and 25 deletions

View File

@@ -22,10 +22,35 @@ use Doctrine\Common\Cache\ArrayCache as DoctrineArray;
class ArrayCache extends DoctrineArray implements Cache
{
public function flushAll()
public function isServer()
{
$this->data = array();
return true;
return false;
}
public function getStats()
{
return null;
}
public function get($id)
{
if (!$this->contains($id))
{
throw new Exception(sprintf('Unable to find key %s', $id));
}
return $this->fetch($id);
}
public function deleteMulti(array $array_keys)
{
foreach ($array_keys as $id)
{
$this->delete($id);
}
return;
}
}