mirror of
https://gitee.com/ShopeX/OMS
synced 2026-03-23 02:45:33 +08:00
85 lines
1.7 KiB
PHP
85 lines
1.7 KiB
PHP
<?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
|