\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) 

Set cache

Parameters

string $key

cache key

mixed $value

cache content data

integer $expire

cache expire time, unit: seconds, not timestamp

get()

get(string  $key) : mixed

Get cache

Parameters

string $key

cache key

Returns

mixed —

return null when fail

delete()

delete(string  $key) 

Delete cache

Parameters

string $key

createCacheFilePath()

createCacheFilePath(  $key) 

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

Parameters

$key

createCacheFileFolder()

createCacheFileFolder()