PHP Class think\cache\driver\Memcached

Inheritance: extends think\Cache
Show file Open project: top-think/framework Class Usage Examples

Protected Properties

Property Type Description
$options

Public Methods

Method Description
__construct ( array $options = [] ) 架构函数
clear ( string $tag = null ) : boolean 清除缓存
dec ( string $name, integer $step = 1 ) : false | integer 自减缓存(针对数值缓存)
get ( string $name, mixed $default = false ) : mixed 读取缓存
has ( string $name ) : boolean 判断缓存
inc ( string $name, integer $step = 1 ) : false | integer 自增缓存(针对数值缓存)
rm ( string $name, boolean | false $ttl = false ) : boolean 删除缓存
set ( string $name, mixed $value, integer $expire = null ) : boolean 写入缓存

Method Details

__construct() public method

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

clear() public method

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

dec() public method

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

get() public method

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

has() public method

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

inc() public method

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

rm() public method

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

set() public method

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

Property Details

$options protected property

protected $options