Files
OMS/app/base/lib/cache/abstract.php
2025-12-28 23:13:25 +08:00

85 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
/*
* @package base
* @copyright Copyright (c) 2010, shopex. inc
* @author edwin.lzh@gmail.com
* @license
*/
abstract class base_cache_abstract
{
/*
* @var string $_vary_list
* @access protected
*/
protected $_vary_list;
/*
* 检查是否取得影响缓存的相关数据,如果无则获取一次
* @access public
* @return void
*/
protected function check_vary_list()
{
if(!isset($this->_vary_list)){
$this->_vary_list = cachemgr::fetch_vary_list();
}
}//End Function
/*
* 取得数据
* @var string $type
* @var string $key
* @access public
* @return mixed
*/
public function get_modified($type, $key)
{
return $this->_vary_list[strtoupper($type)][strtoupper($key)];
}//End Function
/*
* 设置数据
* @var string $type
* @var string $key
* @var int $time
* @access public
* @return boolean
*/
public function set_modified($type, $key, $time=0)
{
$now = ($time>0) ? $time : time();
if(is_array($key)){
foreach($key as $k){
$this->_vary_list[strtoupper($type)][strtoupper($k)] = $now;
}
}else{
$this->_vary_list[strtoupper($type)][strtoupper($key)] = $now;
}
return true;
}//End Function
/**
* 是否支持同步的自增单号处理
*/
public function supportUUID() {
return false;
}
/**
* 返回类型值
*/
public function getUUIDFix() {
return '2';
}
}//End Class