mirror of
https://gitee.com/ShopeX/OMS
synced 2026-03-23 19:05:34 +08:00
59 lines
1.4 KiB
PHP
59 lines
1.4 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
|
||
*/
|
||
class base_cache_ecae extends base_cache_abstract implements base_interface_cache
|
||
{
|
||
|
||
function __construct()
|
||
{
|
||
$this->check_vary_list();
|
||
}//End Function
|
||
|
||
/**
|
||
* fetch
|
||
* @param mixed $key key
|
||
* @param mixed $result result
|
||
* @return mixed 返回值
|
||
*/
|
||
public function fetch($key, &$result)
|
||
{
|
||
$result = ecae_cache_read($key);
|
||
return $result !== false;
|
||
}//End Function
|
||
|
||
/**
|
||
* store
|
||
* @param mixed $key key
|
||
* @param mixed $value value
|
||
* @param mixed $ttl ttl
|
||
* @return mixed 返回值
|
||
*/
|
||
public function store($key, $value, $ttl=0)
|
||
{
|
||
return ecae_cache_write($key, $value);
|
||
}//End Function
|
||
|
||
/**
|
||
* status
|
||
* @return mixed 返回值
|
||
*/
|
||
public function status()
|
||
{
|
||
$status = ecae_cache_stats();
|
||
foreach($status AS $key=>$value){
|
||
$return[$key.'=>缓存获取'] = $value['cmd_get'];
|
||
$return[$key.'=>缓存存储'] = $value['cmd_set'];
|
||
$return[$key.'=>可使用缓存'] = $value['limit_maxbytes']/1024/1024 ." MB";
|
||
}
|
||
return $return;
|
||
}//End Function
|
||
}//End Class
|