forked from itxiao6/database
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CacheInterface.php
55 lines (48 loc) · 946 Bytes
/
CacheInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace Itxiao6\Database;
/**
* 缓存接口
* Interface CacheInterface
* @package Itxiao6\Database
*/
interface CacheInterface
{
/**
* 生成缓存的key
* @param $keyword
* @return string
*/
public function make_name($keyword);
/**
* 设置值
* @param $name
* @param $value
* @param $time
* @return mixed
*/
public function set($name,$value,$time);
/**
* 获取值
* @param $name
* @return mixed
*/
public function get($name);
/**
* 判断缓存连接 是否通畅
* @return bool
*/
public function ping();
/**
* 重新连接
* @return bool
*/
public function reconnect();
/**
* 记住数据
* @param string $name
* @param \Closure|null $callback
* @param int $time
* @return mixed
*/
public function remember($name,$callback = null,$time = 0);
}