21 $cacheType=$cacheParams[
'type'];
22 $defaultParams=[
'defaultTtl'=>86400,
'itemDetailedDate'=>
true];
23 $cacheParams=\array_merge($cacheParams,$defaultParams);
24 $this->cacheInstance = CacheManager::getInstance($cacheType,$cacheParams);
33 return $this->cacheInstance->hasItem($this->
getRealKey($key));
36 public function store($key, $code,$tag=null, $php=
true) {
48 $item=$this->cacheInstance->getItem($key);
51 $this->cacheInstance->save($item);
55 $key=\str_replace(
"/",
"-", $key);
56 return \str_replace(
"\\",
"-", $key);
65 $result=$this->cacheInstance->getItem($this->
getRealKey($key))->get();
75 return $this->cacheInstance->getItem($this->
getRealKey($key))->get();
86 return $this->cacheInstance->getItem($key)->getModificationDate()->getTimestamp();
89 public function remove($key) {
91 $this->cacheInstance->deleteItem($this->
getRealKey($key));
95 $this->cacheInstance->clear();
99 return $this->cacheInstance->getItemsByTag($type);
106 foreach ($entries as $entry) {
107 $key=$entry->getKey();
108 $result[]=
new CacheFile(\ucfirst($type),$key,$entry->getCreationDate()->getTimestamp(),
"",$key);
110 if(\
sizeof($result)===0)
111 $result[]=
new CacheFile(\ucfirst($type),
"",
"",
"");
116 $this->cacheInstance->deleteItemsByTag($type);
120 return parent::getCacheInfo().
"<br>Driver name : <b>".$this->cacheInstance->getDriverName().
"</b>";
124 return $this->cacheInstance->getItem($this->
getRealKey($key))->getKey();
fetch($key)
Fetches data stored for the given key.
exists($key)
Check if annotation-data for the key has been stored.
storeContent($key, $content, $tag)
Caches the given data with the given key.
Inspired by (c) Rasmus Schultz rasmus@mindplay.dk https://github.com/mindplay-dk/php-annotations ...
store($key, $code, $tag=null, $php=true)
file_get_contents($key)
return data stored for the given key.
This class is responsible for storing Arrays in PHP files.
getTimestamp($key)
Returns the timestamp of the last cache update for the given key.
__construct($root, $postfix="", $cacheParams=[])
Initializes the cache-provider.
This class is responsible for storing values with PhpFastCache.