PHP Class CacheMemcache, thinksns

Inheritance: implements cachemanager
Exibir arquivo Open project: medz/thinksns-4 Class Usage Examples

Public Methods

Method Description
__construct ( array $options = [] ) 架构函数
clear ( ) : boolen 清除缓存
get ( string $name ) : mixed 读取缓存
getMulti ( string $prefix, $key ) : mixed 批量读取缓存
rm ( string $name, $ttl = false ) : boolen 删除缓存
set ( string $name, mixed $value, integer $expire = null ) : boolen 写入缓存

Method Details

__construct() public method

架构函数
public __construct ( array $options = [] )
$options array 缓存参数

clear() public method

清除缓存
public clear ( ) : boolen
return boolen

get() public method

读取缓存
public get ( string $name ) : mixed
$name string 缓存变量名
return mixed

getMulti() public method

批量读取缓存
public getMulti ( string $prefix, $key ) : mixed
$prefix string 缓存前缀
return mixed

rm() public method

删除缓存
public rm ( string $name, $ttl = false ) : boolen
$name string 缓存变量名
return boolen

set() public method

写入缓存
public set ( string $name, mixed $value, integer $expire = null ) : boolen
$name string 缓存变量名
$value mixed 存储数据
$expire integer 有效时间(秒)
return boolen