\PhalApi_Cache_File

PhalApi_Cache_File 文件缓存

Summary

Methods
Properties
Constants
__construct()
set()
get()
delete()
No public properties found
No constants found
createCacheFilePath()
createCacheFileFolder()
$folder
$prefix
N/A
No private methods found
No private properties found
N/A

Properties

$folder

$folder : 

Type

$prefix

$prefix : 

Type

Methods

__construct()

__construct(  $config) 

Parameters

$config

set()

set(string  $key, mixed  $value, integer  $expire = 600) 

设置缓存

Parameters

string $key

缓存key

mixed $value

缓存的内容

integer $expire

缓存有效时间,单位秒,非时间戳

get()

get(string  $key) : mixed

读取缓存

Parameters

string $key

缓存key

Returns

mixed —

失败情况下返回NULL

delete()

delete(string  $key) 

删除缓存

Parameters

string $key

createCacheFilePath()

createCacheFilePath(  $key) 

考虑到Linux同一目录下的文件个数限制,这里拆分成1000个文件缓存目录

Parameters

$key

createCacheFileFolder()

createCacheFileFolder()