1 Star 0 Fork 2

dikiking/xiunophp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
cache_yac.class.php 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
skiy 提交于 2020-08-06 14:36 . init from xiunobbs
<?php
class cache_yac {
public $yac = NULL;
public $cachepre = '';
public $errno = 0;
public $errstr = '';
public function __construct($conf = array()) {
if(!class_exists('Yac')) {
return $this->error(1, 'yac 扩展没有加载,请检查您的 PHP 版本');
}
$this->cachepre = isset($conf['cachepre']) ? $conf['cachepre'] : 'pre_';
$this->yac = new Yac($this->cachepre);
}
public function connect() {
}
public function set($k, $v, $life) {
return $this->yac->set($k, $v, $life);
}
// 取不到数据的时候返回 NULL,不是 FALSE
public function get($k) {
$r = $this->yac->get($k);
if($r === FALSE) $r = NULL;
return $r;
}
public function delete($k) {
return $this->yac->delete($k);
}
public function truncate() {
$this->yac->flush();
return TRUE;
}
public function error($errno = 0, $errstr = '') {
$this->errno = $errno;
$this->errstr = $errstr;
DEBUG AND trigger_error('Cache Error:'.$this->errstr);
}
public function __destruct() {
}
}
?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dikiking/xiunophp.git
git@gitee.com:dikiking/xiunophp.git
dikiking
xiunophp
xiunophp
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385