TwigPhpStorageCache

Provides an alternate cache storage for Twig using PhpStorage.

This class is designed to work on setups with multiple webheads using a local filesystem for the twig cache. When generating the cache key, a hash value depending on the enabled extensions is included. This prevents stale templates from being reused when twig extensions are enabled or disabled.

Hierarchy

See also

\Drupal\Core\DependencyInjection\Compiler\TwigExtensionPass

File

core/lib/Drupal/Core/Template/TwigPhpStorageCache.php, line 18

Namespace

Drupal\Core\Template

Members

Name Modifiers Type Description
TwigPhpStorageCache::$cache protected property The cache object used for auto-refresh via mtime.
TwigPhpStorageCache::$storage protected property The PhpStorage object used for storing the templates.
TwigPhpStorageCache::$templateCacheFilenamePrefix protected property The template cache filename prefix.
TwigPhpStorageCache::generateKey public function Generates a cache key for the given template class name. Overrides Twig_CacheInterface::generateKey
TwigPhpStorageCache::getTimestamp public function Returns the modification timestamp of a key. Overrides Twig_CacheInterface::getTimestamp
TwigPhpStorageCache::load public function Loads a template from the cache. Overrides Twig_CacheInterface::load
TwigPhpStorageCache::storage protected function Gets the PHP code storage object to use for the compiled Twig files.
TwigPhpStorageCache::write public function Writes the compiled template to cache. Overrides Twig_CacheInterface::write
TwigPhpStorageCache::__construct public function Store cache backend and other information internally.
doc_Drupal
2016-10-29 09:49:45
Comments
Leave a Comment

Please login to continue.