FileCache
in package
implements
RequestCacheInterface
Tags
Interfaces, Classes and Traits
- RequestCacheInterface
- Interface CacheInterface
Table of Contents
- $cacheKey : string
- $cachePath : string
- $config : array<string|int, mixed>
- $driver : FileCacheDriver
- $expireTime : int
- 缓存过期时间(秒)
- __construct() : mixed
- FileCache constructor.
- get() : mixed
- 获取缓存内容
- getConfig() : mixed
- 获取缓存配置
- isValid() : bool
- 是否有效
- set() : void
- 写入缓存
- setConfig() : mixed
- 缓存配置
Properties
$cacheKey
private
string
$cacheKey
$cachePath
private
string
$cachePath
$config
private
array<string|int, mixed>
$config
$driver
private
FileCacheDriver
$driver
$expireTime
缓存过期时间(秒)
private
int
$expireTime
= 3600
Methods
__construct()
FileCache constructor.
public
__construct(array<string|int, mixed> $config) : mixed
Parameters
- $config : array<string|int, mixed>
Tags
Return values
mixed —get()
获取缓存内容
public
get() : mixed
Return values
mixed —get cache
getConfig()
获取缓存配置
public
getConfig() : mixed
Return values
mixed —isValid()
是否有效
public
isValid() : bool
Return values
bool —set()
写入缓存
public
set(string $value) : void
Parameters
- $value : string
Tags
Return values
void —setConfig()
缓存配置
public
setConfig([array<string|int, mixed> $config = [] ]) : mixed
Parameters
- $config : array<string|int, mixed> = []