/
CacheInterface.php
64 lines (57 loc) · 1.33 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/*
* This file is part of Twig.
*
* (c) 2014 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Interface Twig_Cache_CacheInterface needs to be implemented by cache classes
*
* @author Andrew Tch <andrew@noop.lv>
*/
interface Twig_Cache_CacheInterface
{
/**
* Returns cache key depending on current implementation.
*
* @param string $className Template class name
* @param string $prefix Global template class prefix
* @return string
*/
public function getCacheKey($className, $prefix);
/**
* Clears all cached templates
*/
public function clear();
/**
* Checks if given cache entity exists.
*
* @param string $key
* @return bool
*/
public function has($key);
/**
* Writes compiled template to cache.
*
* @param $key
* @param $content
*/
public function write($key, $content);
/**
* Loads cache file. This function returns nothing, it should require or eval() the compiled template.
*
* @param $key
*/
public function load($key);
/**
* Returns timestamp of cached template..
*
* @param $key
*
* @return int
*/
public function getTimestamp($key);
}