PHP 클래스 think\cache\driver\Redis

要求安装phpredis扩展:https://github.com/nicolasff/phpredis
저자: 尘缘 ([email protected])
상속: extends think\cache\Driver
파일 보기 프로젝트 열기: top-think/framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$options

공개 메소드들

메소드 설명
__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 删除缓存
set ( string $name, mixed $value, integer $expire = null ) : boolean 写入缓存

메소드 상세

__construct() 공개 메소드

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

clear() 공개 메소드

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

dec() 공개 메소드

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

get() 공개 메소드

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

has() 공개 메소드

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

inc() 공개 메소드

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

rm() 공개 메소드

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

set() 공개 메소드

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

프로퍼티 상세

$options 보호되어 있는 프로퍼티

protected $options