-
Notifications
You must be signed in to change notification settings - Fork 0
/
CacherInterface.php
54 lines (47 loc) · 1020 Bytes
/
CacherInterface.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
<?php
/**
* Cacher interface
*/
namespace GetPhoto\Oauth2\Client\Cache;
interface CacherInterface {
/**
* Set cache prefix
*
* @param string $prefix
*/
public function setPrefix($prefix);
/**
* Get cache prefix
*
* @return string
*/
public function getPrefix();
/**
* Write to cache
*
* @param string $key Identifier for the data
* @param mixed $value Data to be cached - anything except a resource
* @return bool True if the data was successfully cached, false on failure
*/
public function write($key, $value);
/**
* Read from cache
*
* @param string $key Identifier for the data
* @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
*/
public function read($key);
/**
* Delete from cache
*
* @param string $key Identifier for the data
* @return bool success
*/
public function delete($key);
/**
* Clear all cached vars
*
* @return bool success
*/
public function clear();
}