ThinkPHP5


think\cache\driver\Lite
library\think\cache\driver\Lite.php at line 20

Class Lite

Driver
└─Lite

public class Lite
extends Driver

文件类型缓存类

Author:
liu21st

Constructor Summary
void

__construct(array options)

架构函数

Method Summary
protected string

getCacheKey(string name)

取得变量的存储文件名

mixed

has(string name)

判断缓存是否存在

mixed

get(string name, mixed default)

读取缓存

bool

set(string name, mixed value, int expire)

写入缓存

false|int

inc(string name, int step)

自增缓存(针对数值缓存)

false|int

dec(string name, int step)

自减缓存(针对数值缓存)

boolean

rm(string name)

删除缓存

bool

clear(string tag)

清除缓存

Methods inherited from think\cache\Driver
clear, dec, get, getCacheKey, getTagItem, handler, has, inc, pull, rm, set, setTagItem, tag

Constructor Detail

library\think\cache\driver\Lite.php at line 30

__construct

public void __construct(array options)

架构函数


Method Detail

library\think\cache\driver\Lite.php at line 47

getCacheKey

protected string getCacheKey(string name)

取得变量的存储文件名

Parameters:
name - 缓存变量名

library\think\cache\driver\Lite.php at line 58

has

public mixed has(string name)

判断缓存是否存在

Parameters:
name - 缓存变量名

library\think\cache\driver\Lite.php at line 70

get

public mixed get(string name, mixed default)

读取缓存

Parameters:
name - 缓存变量名
default - 默认值

library\think\cache\driver\Lite.php at line 95

set

public bool set(string name, mixed value, int expire)

写入缓存

Parameters:
name - 缓存变量名
value - 存储数据
expire - 有效时间 0为永久

library\think\cache\driver\Lite.php at line 124

inc

public false|int inc(string name, int step)

自增缓存(针对数值缓存)

Parameters:
name - 缓存变量名
step - 步长

library\think\cache\driver\Lite.php at line 141

dec

public false|int dec(string name, int step)

自减缓存(针对数值缓存)

Parameters:
name - 缓存变量名
step - 步长

library\think\cache\driver\Lite.php at line 157

rm

public boolean rm(string name)

删除缓存

Parameters:
name - 缓存变量名

library\think\cache\driver\Lite.php at line 168

clear

public bool clear(string tag)

清除缓存

Parameters:
tag - 标签名

ThinkPHP5