Apply PSR-12 code style (#3886)
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / cache / source / ICacheSource.class.php
1 <?php
2
3 namespace wcf\system\cache\source;
4
5 /**
6 * Any cache sources should implement this interface.
7 *
8 * @author Alexander Ebert
9 * @copyright 2001-2019 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package WoltLabSuite\Core\System\Cache\Source
12 */
13 interface ICacheSource
14 {
15 /**
16 * Flushes a specific cache, optionally removing caches which share the same name.
17 *
18 * @param string $cacheName
19 * @param bool $useWildcard
20 */
21 public function flush($cacheName, $useWildcard);
22
23 /**
24 * Clears the cache completely.
25 */
26 public function flushAll();
27
28 /**
29 * Returns a cached variable.
30 *
31 * @param string $cacheName
32 * @param int $maxLifetime
33 * @return mixed
34 */
35 public function get($cacheName, $maxLifetime);
36
37 /**
38 * Stores a variable in the cache.
39 *
40 * @param string $cacheName
41 * @param mixed $value
42 * @param int $maxLifetime
43 */
44 public function set($cacheName, $value, $maxLifetime);
45 }