-
Notifications
You must be signed in to change notification settings - Fork 0
/
CacheInterface.php
40 lines (36 loc) · 1.12 KB
/
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
<?php
interface CacheInterface
{
/**
* Get data from the cache.
*
* @param string $key Cache key
* @param bool $success Set to TRUE if data was sucessfully retrieved,
* FALSE if not data was found for the provided cache key
* @return string Stored data.
*/
function retrieve($key, &$success = null);
/**
* Checks if the cache has data associated to a key.
*
* @param string $key
* @return bool TRUE if the cache has data. FALSE if nothing is found.
*/
function contains($key);
/**
* Set data for a key in cache.
*
* @param string $key Cache key
* @param string $data Data, non string data must first be encoded
* @param int $ttl Time to live in seconds, values <= 0 disable TTL
* @return bool TRUE if data successfully stored. FALSE in case of error.
*/
function store($key, $data, $TTL = 0);
/**
* Drop data associated to a key.
*
* @param string $key Cache key
* @return bool TRUE if data successfully removed. FALSE in case of error.
*/
function remove($key);
}