-
Notifications
You must be signed in to change notification settings - Fork 21
/
CacheClientInterface.php
51 lines (46 loc) · 1.07 KB
/
CacheClientInterface.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
<?php
namespace Beryllium\CacheBundle;
/**
* Minimum requirements for interfacing with a typical key-value store
*
* @package
* @version $id$
* @author Kevin Boyd <[email protected]>
* @license See LICENSE.md
*/
interface CacheClientInterface
{
/**
* Retrieve the value corresponding to a provided key
*
* @param string $key Unique identifier
* @access public
* @return mixed Result from the cache
*/
public function get( $key );
/**
* Add a value to the cache under a unique key
*
* @param string $key Unique key to identify the data
* @param mixed $value Data to store in the cache
* @param int $ttl Lifetime for stored data (in seconds)
* @access public
* @return void
*/
public function set( $key, $value, $ttl );
/**
* Delete a value from the cache
*
* @param string $key
* @access public
* @return void
*/
public function delete( $key );
/**
* Check the state of the cache
*
* @access public
* @return boolean True if the cache is in a usable state, otherwise false
*/
public function isSafe();
}