PHP Class think\cache\Driver

Mostrar archivo Open project: top-think/framework

Protected Properties

Property Type Description
$handler
$options
$tag

Public Methods

Method Description
clear ( string $tag = null ) : boolean 清除缓存
dec ( string $name, integer $step = 1 ) : false | integer 自减缓存(针对数值缓存)
get ( string $name, mixed $default = false ) : mixed 读取缓存
handler ( ) : object 返回句柄对象,可执行其它高级方法
has ( string $name ) : boolean 判断缓存是否存在
inc ( string $name, integer $step = 1 ) : false | integer 自增缓存(针对数值缓存)
pull ( string $name ) : mixed 读取缓存并删除
rm ( string $name ) : boolean 删除缓存
set ( string $name, mixed $value, integer $expire = null ) : boolean 写入缓存
tag ( string $name, string | array $keys = null, boolean $overlay = false ) 缓存标签

Protected Methods

Method Description
getCacheKey ( string $name ) : string 获取实际的缓存标识
getTagItem ( string $tag ) : array 获取标签包含的缓存标识
setTagItem ( string $name ) : void 更新标签

Method Details

clear() abstract public method

清除缓存
abstract public clear ( string $tag = null ) : boolean
$tag string 标签名
return boolean

dec() abstract public method

自减缓存(针对数值缓存)
abstract public dec ( string $name, integer $step = 1 ) : false | integer
$name string 缓存变量名
$step integer 步长
return false | integer

get() abstract public method

读取缓存
abstract public get ( string $name, mixed $default = false ) : mixed
$name string 缓存变量名
$default mixed 默认值
return mixed

getCacheKey() protected method

获取实际的缓存标识
protected getCacheKey ( string $name ) : string
$name string 缓存名
return string

getTagItem() protected method

获取标签包含的缓存标识
protected getTagItem ( string $tag ) : array
$tag string 缓存标签
return array

handler() public method

返回句柄对象,可执行其它高级方法
public handler ( ) : object
return object

has() abstract public method

判断缓存是否存在
abstract public has ( string $name ) : boolean
$name string 缓存变量名
return boolean

inc() abstract public method

自增缓存(针对数值缓存)
abstract public inc ( string $name, integer $step = 1 ) : false | integer
$name string 缓存变量名
$step integer 步长
return false | integer

pull() public method

读取缓存并删除
public pull ( string $name ) : mixed
$name string 缓存变量名
return mixed

rm() abstract public method

删除缓存
abstract public rm ( string $name ) : boolean
$name string 缓存变量名
return boolean

set() abstract public method

写入缓存
abstract public set ( string $name, mixed $value, integer $expire = null ) : boolean
$name string 缓存变量名
$value mixed 存储数据
$expire integer 有效时间 0为永久
return boolean

setTagItem() protected method

更新标签
protected setTagItem ( string $name ) : void
$name string 缓存标识
return void

tag() public method

缓存标签
public tag ( string $name, string | array $keys = null, boolean $overlay = false )
$name string 标签名
$keys string | array 缓存标识
$overlay boolean 是否覆盖

Property Details

$handler protected_oe property

protected $handler

$options protected_oe property

protected $options

$tag protected_oe property

protected $tag