5
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17
* This software consists of voluntary contributions made by many individuals
18
* and is licensed under the MIT license. For more information, see
19
* <http://www.doctrine-project.org>.
22
namespace Doctrine\Common\Cache;
25
* Interface for cache drivers.
27
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
28
* @link www.doctrine-project.org
30
* @author Benjamin Eberlei <kontakt@beberlei.de>
31
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
32
* @author Jonathan Wage <jonwage@gmail.com>
33
* @author Roman Borschel <roman@code-factory.org>
34
* @author Fabio B. Silva <fabio.bat.silva@gmail.com>
38
const STATS_HITS = 'hits';
39
const STATS_MISSES = 'misses';
40
const STATS_UPTIME = 'uptime';
41
const STATS_MEMORY_USAGE = 'memory_usage';
42
const STATS_MEMORY_AVAILIABLE = 'memory_available';
45
* Fetches an entry from the cache.
47
* @param string $id cache id The id of the cache entry to fetch.
48
* @return mixed The cached data or FALSE, if no cache entry exists for the given id.
53
* Test if an entry exists in the cache.
55
* @param string $id cache id The cache id of the entry to check for.
56
* @return boolean TRUE if a cache entry exists for the given cache id, FALSE otherwise.
58
function contains($id);
61
* Puts data into the cache.
63
* @param string $id The cache id.
64
* @param mixed $data The cache entry/data.
65
* @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime).
66
* @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise.
68
function save($id, $data, $lifeTime = 0);
71
* Deletes a cache entry.
73
* @param string $id cache id
74
* @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.
79
* Retrieves cached information from data store
81
* The server's statistics array has the following values:
84
* Number of keys that have been requested and found present.
87
* Number of items that have been requested and not found.
90
* Time that the server is running.
92
* - <b>memory_usage</b>
93
* Memory used by this server to store items.
95
* - <b>memory_available</b>
96
* Memory allowed to use for storage.
99
* @var array Associative array with server's statistics if available, NULL otherwise.