4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Config;
14 use Symfony\Component\Config\Resource\ResourceInterface;
17 * Interface for ConfigCache.
19 * @author Matthias Pigulla <mp@webfactory.de>
21 interface ConfigCacheInterface
24 * Gets the cache file path.
26 * @return string The cache file path
28 public function getPath();
31 * Checks if the cache is still fresh.
33 * This check should take the metadata passed to the write() method into consideration.
35 * @return bool Whether the cache is still fresh
37 public function isFresh();
40 * Writes the given content into the cache file. Metadata will be stored
41 * independently and can be used to check cache freshness at a later time.
43 * @param string $content The content to write into the cache
44 * @param ResourceInterface[]|null $metadata An array of ResourceInterface instances
46 * @throws \RuntimeException When the cache file cannot be written
48 public function write($content, array $metadata = null);