20 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
63 var $settings = array();
91 function init($settings)
95 parent::init($settings);
96 $defaults = array(
'fields' => array(
'data' ,
'expires'));
97 $this->settings = array_merge($defaults, $this->settings);
98 $this->fields = $this->settings[
'fields'];
110 return $this->model->deleteAll(
new Criteria($this->fields[1], time,
'<= '));
122 function write($key, $data, $duration)
125 $data = serialize($data);
130 $cache_obj = $this->model->create();
131 $cache_obj->setVar($this->model::KEYNAME, $key);
132 $cache_obj->setVar($this->fields[0], $data);
133 $cache_obj->setVar($this->fields[1], time() + $duration);
134 return $this->model->insert($cache_obj);
153 return unserialize($data[0]);
163 function delete($key)
165 return $this->model->delete($key);
176 return $this->model->deleteAll();
198 parent::__construct();