更新到正式版1.0

This commit is contained in:
zyx0814
2022-05-02 22:31:35 +08:00
Unverified
parent 22d2a07209
commit a0f3e375e4
540 changed files with 95625 additions and 111495 deletions

View File

@@ -1,41 +1,41 @@
<?php
if(!defined('IN_OAOOA')) {
exit('Access Denied');
}
class ultrax_cache {
function ultrax_cache($conf) {
$this->conf = $conf;
}
function get_cache($key) {
static $data = null;
if(!isset($data[$key])) {
$cache = C::t('cache')->fetch($key);
if(!$cache) {
return false;
}
$data[$key] = unserialize($cache['cachevalue']);
if($cache['life'] && ($cache['dateline'] < time() - $data[$key]['life'])) {
return false;
}
}
return $data[$key]['data'];
}
function set_cache($key, $value, $life) {
$data = array(
'cachekey' => $key,
'cachevalue' => serialize(array('data' => $value, 'life' => $life)),
'dateline' => time(),
);
return C::t('cache')->insert($data);
}
function del_cache($key) {
return C::t('cache')->delete($key);
}
}
<?php
if(!defined('IN_OAOOA')) {
exit('Access Denied');
}
class ultrax_cache {
function ultrax_cache($conf) {
$this->conf = $conf;
}
function get_cache($key) {
static $data = null;
if(!isset($data[$key])) {
$cache = C::t('cache')->fetch($key);
if(!$cache) {
return false;
}
$data[$key] = unserialize($cache['cachevalue']);
if($cache['life'] && ($cache['dateline'] < time() - $data[$key]['life'])) {
return false;
}
}
return $data[$key]['data'];
}
function set_cache($key, $value, $life) {
$data = array(
'cachekey' => $key,
'cachevalue' => serialize(array('data' => $value, 'life' => $life)),
'dateline' => time(),
);
return C::t('cache')->insert($data);
}
function del_cache($key) {
return C::t('cache')->delete($key);
}
}
?>