4 * This file is part of Twig.
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
13 * Interface implemented by cache classes.
15 * It is highly recommended to always store templates on the filesystem to
16 * benefit from the PHP opcode cache. This interface is mostly useful if you
17 * need to implement a custom strategy for storing templates on the filesystem.
19 * @author Andrew Tch <andrew@noop.lv>
21 interface Twig_CacheInterface
24 * Generates a cache key for the given template class name.
26 * @param string $name The template name
27 * @param string $className The template class name
31 public function generateKey($name, $className);
34 * Writes the compiled template to cache.
36 * @param string $key The cache key
37 * @param string $content The template representation as a PHP class
39 public function write($key, $content);
42 * Loads a template from the cache.
44 * @param string $key The cache key
46 public function load($key);
49 * Returns the modification timestamp of a key.
51 * @param string $key The cache key
55 public function getTimestamp($key);
58 class_alias('Twig_CacheInterface', 'Twig\Cache\CacheInterface', false);