代码拉取完成,页面将自动刷新
<?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() {
}
}
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。