diff --git a/core/composer.json b/core/composer.json index fd7223c..0d83258 100644 --- a/core/composer.json +++ b/core/composer.json @@ -17,7 +17,7 @@ "symfony/validator": "2.7.*", "symfony/process": "2.7.*", "symfony/yaml": "2.7.*", - "twig/twig": "~1.22", + "twig/twig": "1.x-dev", "doctrine/common": "2.5.*", "doctrine/annotations": "1.2.*", "guzzlehttp/guzzle": "~6.1", diff --git a/core/composer.lock b/core/composer.lock index 98186db..2ab10c4 100644 --- a/core/composer.lock +++ b/core/composer.lock @@ -4,7 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "73c9bbe9f22815a79f6d63f9b9afa772", + "hash": "f193c94c598d7fc173f5e1e86d7393e4", + "content-hash": "4baf7e87b846834c93b6bac358028791", "packages": [ { "name": "doctrine/annotations", @@ -1778,16 +1779,16 @@ }, { "name": "twig/twig", - "version": "v1.22.1", + "version": "1.x-dev", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "b7fc2469fa009897871fb95b68237286fc54a5ad" + "reference": "9fde02fe552256722466c9985520b6f50c9c759b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/b7fc2469fa009897871fb95b68237286fc54a5ad", - "reference": "b7fc2469fa009897871fb95b68237286fc54a5ad", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/9fde02fe552256722466c9985520b6f50c9c759b", + "reference": "9fde02fe552256722466c9985520b6f50c9c759b", "shasum": "" }, "require": { @@ -1835,7 +1836,7 @@ "keywords": [ "templating" ], - "time": "2015-09-15 06:50:16" + "time": "2015-09-16 08:32:19" }, { "name": "zendframework/zend-diactoros", @@ -3372,6 +3373,7 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { + "twig/twig": 20, "behat/mink-goutte-driver": 20 }, "prefer-stable": true, diff --git a/core/lib/Drupal/Core/Template/TwigCacheChain.php b/core/lib/Drupal/Core/Template/TwigCacheChain.php index 332a02a..fc5c41b 100644 --- a/core/lib/Drupal/Core/Template/TwigCacheChain.php +++ b/core/lib/Drupal/Core/Template/TwigCacheChain.php @@ -23,7 +23,7 @@ class TwigCacheChain implements \Twig_CacheInterface { * Store cache classes internally. * * @param \Twig_CacheInterface[] $caches - * The cache classes to chain. + * The ordered cache classes to chain. */ public function __construct(array $caches) { assert('Drupal\\Component\\Assertion\\Inspector::assertAllObjects($caches, \'\\Twig_CacheInterface\')'); @@ -58,8 +58,8 @@ public function load($key) { foreach ($this->caches as $cache) { if ($cache->has($key)) { $cache->load($key); + return; } - return; } } diff --git a/core/lib/Drupal/Core/Template/TwigCacheNull.php b/core/lib/Drupal/Core/Template/TwigCacheNull.php new file mode 100644 index 0000000..3992836 --- /dev/null +++ b/core/lib/Drupal/Core/Template/TwigCacheNull.php @@ -0,0 +1,22 @@ +buffer[$key]); + } + +} diff --git a/core/lib/Drupal/Core/Template/TwigEnvironment.php b/core/lib/Drupal/Core/Template/TwigEnvironment.php index 405284d..e59b4ac 100644 --- a/core/lib/Drupal/Core/Template/TwigEnvironment.php +++ b/core/lib/Drupal/Core/Template/TwigEnvironment.php @@ -59,8 +59,11 @@ public function __construct($root, CacheBackendInterface $cache, $twig_extension // Ensure autoescaping is always on. $options['autoescape'] = 'html'; + // We set up a chain of cache classes in case there is a failure or race + // condition. The null cache is roughly equivalent to disabling the Twig + // cache entirely. $php_storage_cache = new TwigPhpStorageCache($cache, $twig_extension_hash); - $null_cache = new \Twig_Cache_Null(); + $null_cache = new TwigCacheNull(); if ($options['cache'] === TRUE) { $options['cache'] = new TwigCacheChain([$php_storage_cache, $null_cache]); diff --git a/core/vendor/composer/installed.json b/core/vendor/composer/installed.json index 0655b5b..3ca2ada 100644 --- a/core/vendor/composer/installed.json +++ b/core/vendor/composer/installed.json @@ -3418,17 +3418,17 @@ }, { "name": "twig/twig", - "version": "v1.22.1", - "version_normalized": "1.22.1.0", + "version": "1.x-dev", + "version_normalized": "1.9999999.9999999.9999999-dev", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "b7fc2469fa009897871fb95b68237286fc54a5ad" + "reference": "9fde02fe552256722466c9985520b6f50c9c759b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/b7fc2469fa009897871fb95b68237286fc54a5ad", - "reference": "b7fc2469fa009897871fb95b68237286fc54a5ad", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/9fde02fe552256722466c9985520b6f50c9c759b", + "reference": "9fde02fe552256722466c9985520b6f50c9c759b", "shasum": "" }, "require": { @@ -3438,7 +3438,7 @@ "symfony/debug": "~2.7", "symfony/phpunit-bridge": "~2.7" }, - "time": "2015-09-15 06:50:16", + "time": "2015-09-16 08:32:19", "type": "library", "extra": { "branch-alias": { diff --git a/core/vendor/twig/twig/CHANGELOG b/core/vendor/twig/twig/CHANGELOG index 7e33437..3966a3e 100644 --- a/core/vendor/twig/twig/CHANGELOG +++ b/core/vendor/twig/twig/CHANGELOG @@ -1,3 +1,7 @@ +* 1.22.2 (2015-XX-XX) + + * fixed Twig_Cache_Null logic + * 1.22.1 (2015-09-15) * fixed regression in template_from_string diff --git a/core/vendor/twig/twig/ext/twig/php_twig.h b/core/vendor/twig/twig/ext/twig/php_twig.h index 50f5b45..258ab2f 100644 --- a/core/vendor/twig/twig/ext/twig/php_twig.h +++ b/core/vendor/twig/twig/ext/twig/php_twig.h @@ -15,7 +15,7 @@ #ifndef PHP_TWIG_H #define PHP_TWIG_H -#define PHP_TWIG_VERSION "1.22.1" +#define PHP_TWIG_VERSION "1.22.2-DEV" #include "php.h" diff --git a/core/vendor/twig/twig/lib/Twig/Cache/Null.php b/core/vendor/twig/twig/lib/Twig/Cache/Null.php index 918e4ce..6a9a29b 100644 --- a/core/vendor/twig/twig/lib/Twig/Cache/Null.php +++ b/core/vendor/twig/twig/lib/Twig/Cache/Null.php @@ -16,12 +16,14 @@ */ class Twig_Cache_Null implements Twig_CacheInterface { + private $buffer = array(); + /** * {@inheritdoc} */ public function generateKey($name, $className) { - return ''; + return $className; } /** @@ -37,7 +39,7 @@ public function has($key) */ public function write($key, $content) { - eval('?>'.$content); + $this->buffer[$key] = $content; } /** @@ -45,6 +47,9 @@ public function write($key, $content) */ public function load($key) { + eval('?>'.$this->buffer[$key]); + + unset($this->buffer[$key]); } /** diff --git a/core/vendor/twig/twig/lib/Twig/Environment.php b/core/vendor/twig/twig/lib/Twig/Environment.php index cd167bd..565ec47 100644 --- a/core/vendor/twig/twig/lib/Twig/Environment.php +++ b/core/vendor/twig/twig/lib/Twig/Environment.php @@ -16,7 +16,7 @@ */ class Twig_Environment { - const VERSION = '1.22.1'; + const VERSION = '1.22.2-DEV'; protected $charset; protected $loader;