Cache.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2015 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
11 namespace wcmf\lib\io;
12 
13 /**
14  * Cache defines the interface for cache implementations.
15  *
16  * Caches are divided into different sections, which store
17  * key value pairs.
18  *
19  * @author ingo herwig <ingo@wemove.com>
20  */
21 interface Cache {
22 
23  /**
24  * Check if a key exists in the specified cache
25  * @param $section The caching section
26  * @param $key The cache key
27  * @return boolean
28  */
29  public function exists($section, $key);
30 
31  /**
32  * Get a value from the specified cache
33  * @param $section The caching section
34  * @param $key The cache key
35  * @return Mixed
36  */
37  public function get($section, $key);
38 
39  /**
40  * Store a value in the specified cache
41  * @param $section The caching section
42  * @param $key The key
43  * @param $value The value
44  */
45  public function put($section, $key, $value);
46 
47  /**
48  * Clear the given cache section. The wildcard char '*'
49  * may be added to the section name in order to
50  * clear all matching sections.
51  * @param $section The caching section
52  */
53  public function clear($section);
54 
55  /**
56  * Clear all cache sections
57  */
58  public function clearAll();
59 }
60 ?>
Input/Output related interfaces and classes.
Definition: namespaces.php:21
exists($section, $key)
Check if a key exists in the specified cache.
put($section, $key, $value)
Store a value in the specified cache.
Cache defines the interface for cache implementations.
Definition: Cache.php:21
clear($section)
Clear the given cache section.
clearAll()
Clear all cache sections.