diff --git a/core/lib/Drupal/Core/Template/TwigCacheChain.php b/core/lib/Drupal/Core/Template/TwigCacheChain.php index 956cb6d..f529f67 100644 --- a/core/lib/Drupal/Core/Template/TwigCacheChain.php +++ b/core/lib/Drupal/Core/Template/TwigCacheChain.php @@ -13,7 +13,7 @@ class TwigCacheChain implements \Twig_CacheInterface { /** - * The cache classes to chain. + * The ordered cache classes to chain. * * @var \Twig_CacheInterface[] */ @@ -56,14 +56,10 @@ public function has($key) { */ public function load($key) { foreach ($this->caches as $cache) { - try { - if ($cache->has($key)) { - $cache->load($key); - } - return; - } - catch (\RuntimeException $e) { + if ($cache->has($key)) { + $cache->load($key); } + return; } } @@ -73,11 +69,7 @@ public function load($key) { public function write($key, $content) { // We want to write to all of them. foreach ($this->caches as $cache) { - try { - $cache->write($key, $content); - } - catch (\RuntimeException $e) { - } + $cache->write($key, $content); } } diff --git a/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php b/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php index ce98a26..44bbd27 100644 --- a/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php +++ b/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php @@ -67,7 +67,7 @@ protected function storage() { public function generateKey($name, $className) { // We override the cache filename in order to avoid issues with not using // shared filesystems. The Twig templates for example rely on available Twig - // extensions, so we use the twig extension hash which varies by extensions + // extensions, so we use the Twig extension hash which varies by extensions // and their mtime. // @see \Drupal\Core\DependencyInjection\Compiler\TwigExtensionPass $hash = hash('sha256', $className); @@ -99,7 +99,7 @@ public function write($key, $content) { if (!$this->storage()->save($key, $content)) { throw new \RuntimeException(sprintf('Failed to write Twig cache file "%s".', $key)); } - // Save the last modification time. + // Save the last mtime. $cid = 'twig:' . $key; $this->cache->set($cid, REQUEST_TIME); }