4,250
社区成员
发帖
与我相关
我的任务
分享$kv = new SaeKV();
$ret = $kv->init();
$ret = $kv->pkrget('', 100);
dump($ret);
如果你禁用并重新开启KVDB后,运行上面代码仍然输出缓存内容,那说明KVDB的缓存还在。
复制下面的代码,执行后解决一切问题。
$kv = new SaeKV(); //创建SaeKV对象
$ret = $kv->init(); //初始化
$ret = $kv->pkrget('', 100); //获取缓存内容(帮助文档注明了上限为100条)
$this->show('<h3>当前KVDB缓存内容</h3>');
dump($ret);
//遍历并删除
foreach ($ret as $key => $value) {
$ret = $kv->delete($key);
}
$this->show('<hr>');
$this->show('<h3>清空KVDB缓存后的内容</h3>');
$ret = $kv->pkrget('', 100);
dump($ret);
if (!$ret){
$this->show('<hr>');
$this->show('KVDB清空成功');
};