29 protected function getKey($class, $key) {
30 return \md5 ( $class . $key );
33 public function __construct($cacheSystem = MemCachedDriver::class) {
34 if (\is_string ( $cacheSystem )) {
37 $this->cache = $cacheSystem;
41 public function store($class, $key, $object) {
42 $this->cache->store ( $this->
getKey ( $class, $key ), $object );
45 public function fetch($class, $key) {
46 $k = $this->
getKey ( $class, $key );
47 if (! isset ( $this->items [$k] )) {
48 $this->items [$k] = $this->cache->fetch ( $k );
50 return $this->items [$k];
53 public function delete($class, $key) {
54 $key = $this->
getKey ( $class, $key );
55 if ($this->cache->exists ( $key )) {
56 return $this->cache->remove ( $key );
Manager for caches (Router, Rest, models).
static getCacheSubDirectory(string $subDirectory)
Returns an absolute cache subdirectory.
Ubiquity\cache\dao$AbstractDAOCache This class is part of Ubiquity.
Ubiquity\cache\dao$DAOCache This class is part of Ubiquity.
__construct($cacheSystem=MemCachedDriver::class)
store($class, $key, $object)
This class is responsible for storing Arrays in PHP files.
This class is responsible for storing values with MemCached.