CacheStorage
抽象缓存存储处理程序
| 自 |
1.7.0 |
|---|---|
| 注意 |
从 4.0 开始,此类将是抽象类 |
| 包 |
Joomla CMS |
方法
__construct
构造函数
__construct(mixed||string|int options = []) :
| 自 |
1.7.0 |
|---|
参数
- options
array<string|int, mixed>可选参数
响应
mixed
_getCacheId
从 ID/组对获取缓存 ID 字符串
_getCacheId( id, group) :
| 自 |
1.7.0 |
|---|
参数
- id
string缓存数据 ID- group
string缓存数据组
响应
string
addIncludePath
添加 CacheStorage 应该在其中搜索处理程序的目录。您可以传递字符串或目录数组。
addIncludePath(array|string path = '') : mixed||string|int
| 自 |
1.7.0 |
|---|
参数
- path
array<string|int, mixed>|string要搜索的路径。
响应
array<string|int, mixed>包含目录元素的数组
clean
清除组的缓存,给定模式。
clean( group, mode = null) :
group mode : 清除组中的所有缓存 notgroup mode : 清除组外的所有缓存
| 自 |
1.7.0 |
|---|
参数
- group
string缓存数据组- mode
string用于清除缓存的模式 [group|notgroup]
响应
bool
contains
检查缓存是否包含通过 ID 和组存储的数据
contains( id, group) :
| 自 |
3.7.0 |
|---|
参数
- id
string缓存数据 ID- group
string缓存数据组
响应
bool
flush
刷新存储中的所有现有项。
flush() :
| 自 |
3.6.3 |
|---|
响应
bool
gc
垃圾收集已过期的缓存数据
gc() :
| 自 |
1.7.0 |
|---|
响应
bool
get
通过 ID 和组获取缓存数据
get( id, group, checkTime = true) :
| 自 |
1.7.0 |
|---|
参数
- id
string缓存数据 ID- group
string缓存数据组- checkTime
bool如果要验证缓存时间过期阈值,则为 True
响应
mixed如果失败,则为布尔值 false,否则为缓存数据对象
getAll
获取所有缓存数据
getAll() :
| 自 |
1.7.0 |
|---|
响应
mixed如果失败,则为布尔值 false,否则为缓存数据对象
getInstance
返回缓存存储处理程序对象。
getInstance( handler = null, mixed||string|int options = []) : \Joomla\CMS\Cache\CacheStorage
| 自 |
1.7.0 |
|---|---|
| 抛出 |
|
参数
- handler
string要实例化的缓存存储处理程序- options
array<string|int, mixed>处理程序选项数组
响应
isSupported
测试存储处理程序是否可用。
isSupported() :
| 自 |
3.0.0 |
|---|
响应
bool
lock
锁定缓存项
lock( id, group, locktime) :
| 自 |
1.7.0 |
|---|
参数
- id
string缓存数据 ID- group
string缓存数据组- locktime
int缓存项最大锁定时间
响应
mixed如果锁定失败,则为布尔值 false,否则为包含属性 lock 和 locklooped 的对象
remove
通过 ID 和组删除缓存数据条目
remove( id, group) :
| 自 |
1.7.0 |
|---|
参数
- id
string缓存数据 ID- group
string缓存数据组
响应
bool
store
通过 ID 和组将数据存储到缓存
store( id, group, data) :
| 自 |
1.7.0 |
|---|
参数
- id
string缓存数据 ID- group
string缓存数据组- data
string要存储在缓存中的数据
响应
bool
unlock
解锁缓存项
unlock( id, group = null) :
| 自 |
1.7.0 |
|---|
参数
- id
string缓存数据 ID- group
string缓存数据组
响应
bool
属性
rawname
原始对象名称
| 自 |
1.7.0 |
|---|
类型
string
_now
实例化缓存存储处理程序的时间
| 自 |
1.7.0 |
|---|
类型
int
_lifetime
缓存生存期
| 自 |
1.7.0 |
|---|
类型
int
_locking
如果启用了锁定,则为标志
| 自 |
1.7.0 |
|---|
类型
bool
_language
语言代码
| 自 |
1.7.0 |
|---|
类型
string
_application
应用程序名称
| 自 |
1.7.0 |
|---|
类型
string
_hash
对象哈希
| 自 |
1.7.0 |
|---|
类型
string
_threshold
阈值
| 自 |
4.3.0 |
|---|
类型
int