/**
* 删除组中特定缓存ID的数据
*
* 如果缓存ID不存在并且$force=false时,什么也不会发生,$force默认为false.
*
* 成功的时候$non_existant_objects中会保存该ID,表示这个缓存数据不存在.
*
* @参数 int|string $id 标识缓存中的数据
* @参数 string $group 缓存的分组
* @参数 bool $force Optional. 是否强制删除组中的缓存ID
* @返回值 bool 没有删除时返回false,删除成功时返回true.
*/
function delete($id, $group = 'default', $force = false) {
if (empty ($group))
$group = 'default';
if (!$force && false === $this->get($id, $group, false))
return false;
unset ($this->cache[$group][$id]);
$this->non_existant_objects[$group][$id] = true;
return true;
}
/**
* 清空所有缓存数据
*
* @返回值 bool 永远返回true
*/
function flush() {
$this->cache = array ();
return true;
}
续二:[url]http://baiyuxiong.iteye.com/blog/768997[/url]