composer package updates
[openemr.git] / vendor / twig / twig / lib / Twig / CacheInterface.php
blob776808bfe33ffd6269eb6f24abd72ecc963b328d
1 <?php
3 /*
4 * This file is part of Twig.
6 * (c) Fabien Potencier
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 /**
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
23 /**
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
29 * @return string
31 public function generateKey($name, $className);
33 /**
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);
41 /**
42 * Loads a template from the cache.
44 * @param string $key The cache key
46 public function load($key);
48 /**
49 * Returns the modification timestamp of a key.
51 * @param string $key The cache key
53 * @return int
55 public function getTimestamp($key);
58 class_alias('Twig_CacheInterface', 'Twig\Cache\CacheInterface', false);