5 class Cache extends \Rsi\Fred\Stream\Handler{
10 return md5(implode(
'-',
$handlers) . $filename . print_r($params,
true));
14 return $this->_stream->cache->fetch($key = $this->
key(
$handlers,$filename,$params));
19 return $cache ? $cache[
'time'] : parent::time(
$handlers,$filename,$params);
23 if($cache = $this->
cache(
$handlers,$filename,$params,$key))
return $cache[
'data'];
24 $data = parent::read(
$handlers,$filename,$params);
25 $this->_stream->cache->save($key,[
'data' => $data,
'time' => parent::time(
$handlers,$filename,$params)],$this->ttl);
30 if(parent::save(
$handlers,$filename,$params,$data))
31 $this->_stream->cache->delete($this->
key(
$handlers,$filename,$params));
34 public function delete(
$handlers,$filename,$params = null){
35 if(parent::delete(
$handlers,$filename,$params))
36 $this->_stream->cache->delete($this->key(
$handlers,$filename,$params));
cache($handlers, $filename, $params, &$key=null)
save($handlers, $filename, $params, $data)
read($handlers, $filename, $params=null)
time($handlers, $filename, $params=null)
key($handlers, $filename, $params)