缓存类¶
| 属性 | 值 |
|---|---|
| 命名空间 | fize\cache |
| 类名 | Cache |
| 方法: |
|---|
| 方法名 | 说明 |
|---|---|
| __construct() | 常规调用请请初始化 |
| get() | 获取一个缓存 |
| has() | 查看指定缓存是否存在 |
| set() | 设置一个缓存 |
| remove() | 删除一个缓存 |
| clear() | 清空缓存 |
| getInstance() | 取得实例 |
方法¶
__construct()¶
常规调用请请初始化
public function __construct (
string $handler,
array $config = []
)
| 参数: |
|
|---|
get()¶
获取一个缓存
public static function get (
string $name,
mixed $default = null
) : mixed
| 参数: |
|
|---|
set()¶
设置一个缓存
public static function set (
string $name,
mixed $value,
int $expire = null
)
| 参数: |
|
|---|
getInstance()¶
取得实例
public static function getInstance (
string $handler,
array $config = []
) : \fize\cache\CacheHandler
| 参数: |
|
|---|