forked from beryllium/CacheBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CacheClientInterface.php
42 lines (38 loc) · 944 Bytes
/
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
<?php
namespace Beryllium\CacheBundle;
/**
* Minimum requirements for interfacing with a typical key-value store
*
* @package
* @version $id$
* @author Kevin Boyd <beryllium@beryllium.ca>
* @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 );
/**
* Check the state of the cache
*
* @access public
* @return boolean True if the cache is in a usable state, otherwise false
*/
public function isSafe();
}