\PhalApi_Cache_Multi

PhalApi_Cache_Multi 组合模式下的多级缓存

  • 可以自定义添加多重缓存,注意优先添加高效缓存
  • 最终将委托给各级缓存进行数据的读写,其中读取为短路读取

Summary

Methods
Properties
Constants
addCache()
set()
get()
delete()
No public properties found
No constants found
No protected methods found
$caches
N/A
No private methods found
No private properties found
N/A

Properties

$caches

$caches : 

Type

Methods

addCache()

addCache(\PhalApi_Cache  $cache) 

Parameters

\PhalApi_Cache $cache

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