PHP Class phprs\util\CheckableCache

Author: caoym
Datei anzeigen Open project: caoym/phprs-restful

Public Methods

Method Description
__construct ( object $impl, $tag = '' )
del ( string $name ) 删除
get ( string $name, boolean &$succeeded = null ) : mixed 获取cache
set ( string $name, mixed $var, $ttl, SerializableFunc $expire_check = null ) : boolean 设置cache

Method Details

__construct() public method

public __construct ( object $impl, $tag = '' )
$impl object instanceof of KVCatchInterface

del() public method

删除
public del ( string $name )
$name string

get() public method

获取cache
public get ( string $name, boolean &$succeeded = null ) : mixed
$name string
$succeeded boolean
return mixed

set() public method

设置cache
public set ( string $name, mixed $var, $ttl, SerializableFunc $expire_check = null ) : boolean
$name string
$var mixed
$expire_check SerializableFunc
return boolean 缓存过期检查方法, 缓存过期(超过ttl)后, get时调用, 返回true表示缓存继续可用. 如checker($got_var, $time)