Skip to content

Commit 0dfd852

Browse files
committed
Update and add static files to RC7
1 parent dad194f commit 0dfd852

File tree

16 files changed

+480
-259
lines changed

16 files changed

+480
-259
lines changed

vendor/composer/installed.json

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -3841,69 +3841,6 @@
38413841
"description": "Symfony HttpKernel Component",
38423842
"homepage": "https://symfony.com"
38433843
},
3844-
{
3845-
"name": "twig/twig",
3846-
"version": "v1.22.2",
3847-
"version_normalized": "1.22.2.0",
3848-
"source": {
3849-
"type": "git",
3850-
"url": "https://github.com/twigphp/Twig.git",
3851-
"reference": "79249fc8c9ff62e41e217e0c630e2e00bcadda6a"
3852-
},
3853-
"dist": {
3854-
"type": "zip",
3855-
"url": "https://api.github.com/repos/twigphp/Twig/zipball/79249fc8c9ff62e41e217e0c630e2e00bcadda6a",
3856-
"reference": "79249fc8c9ff62e41e217e0c630e2e00bcadda6a",
3857-
"shasum": ""
3858-
},
3859-
"require": {
3860-
"php": ">=5.2.7"
3861-
},
3862-
"require-dev": {
3863-
"symfony/debug": "~2.7",
3864-
"symfony/phpunit-bridge": "~2.7"
3865-
},
3866-
"time": "2015-09-22 13:59:32",
3867-
"type": "library",
3868-
"extra": {
3869-
"branch-alias": {
3870-
"dev-master": "1.22-dev"
3871-
}
3872-
},
3873-
"installation-source": "dist",
3874-
"autoload": {
3875-
"psr-0": {
3876-
"Twig_": "lib/"
3877-
}
3878-
},
3879-
"notification-url": "https://packagist.org/downloads/",
3880-
"license": [
3881-
"BSD-3-Clause"
3882-
],
3883-
"authors": [
3884-
{
3885-
"name": "Fabien Potencier",
3886-
"email": "fabien@symfony.com",
3887-
"homepage": "http://fabien.potencier.org",
3888-
"role": "Lead Developer"
3889-
},
3890-
{
3891-
"name": "Armin Ronacher",
3892-
"email": "armin.ronacher@active-4.com",
3893-
"role": "Project Founder"
3894-
},
3895-
{
3896-
"name": "Twig Team",
3897-
"homepage": "http://twig.sensiolabs.org/contributors",
3898-
"role": "Contributors"
3899-
}
3900-
],
3901-
"description": "Twig, the flexible, fast, and secure template language for PHP",
3902-
"homepage": "http://twig.sensiolabs.org",
3903-
"keywords": [
3904-
"templating"
3905-
]
3906-
},
39073844
{
39083845
"name": "symfony/twig-bridge",
39093846
"version": "v2.7.5",
@@ -7855,5 +7792,68 @@
78557792
"testing",
78567793
"webdriver"
78577794
]
7795+
},
7796+
{
7797+
"name": "twig/twig",
7798+
"version": "v1.22.3",
7799+
"version_normalized": "1.22.3.0",
7800+
"source": {
7801+
"type": "git",
7802+
"url": "https://github.com/twigphp/Twig.git",
7803+
"reference": "ebfc36b7e77b0c1175afe30459cf943010245540"
7804+
},
7805+
"dist": {
7806+
"type": "zip",
7807+
"url": "https://api.github.com/repos/twigphp/Twig/zipball/ebfc36b7e77b0c1175afe30459cf943010245540",
7808+
"reference": "ebfc36b7e77b0c1175afe30459cf943010245540",
7809+
"shasum": ""
7810+
},
7811+
"require": {
7812+
"php": ">=5.2.7"
7813+
},
7814+
"require-dev": {
7815+
"symfony/debug": "~2.7",
7816+
"symfony/phpunit-bridge": "~2.7"
7817+
},
7818+
"time": "2015-10-13 07:07:02",
7819+
"type": "library",
7820+
"extra": {
7821+
"branch-alias": {
7822+
"dev-master": "1.22-dev"
7823+
}
7824+
},
7825+
"installation-source": "dist",
7826+
"autoload": {
7827+
"psr-0": {
7828+
"Twig_": "lib/"
7829+
}
7830+
},
7831+
"notification-url": "https://packagist.org/downloads/",
7832+
"license": [
7833+
"BSD-3-Clause"
7834+
],
7835+
"authors": [
7836+
{
7837+
"name": "Fabien Potencier",
7838+
"email": "fabien@symfony.com",
7839+
"homepage": "http://fabien.potencier.org",
7840+
"role": "Lead Developer"
7841+
},
7842+
{
7843+
"name": "Armin Ronacher",
7844+
"email": "armin.ronacher@active-4.com",
7845+
"role": "Project Founder"
7846+
},
7847+
{
7848+
"name": "Twig Team",
7849+
"homepage": "http://twig.sensiolabs.org/contributors",
7850+
"role": "Contributors"
7851+
}
7852+
],
7853+
"description": "Twig, the flexible, fast, and secure template language for PHP",
7854+
"homepage": "http://twig.sensiolabs.org",
7855+
"keywords": [
7856+
"templating"
7857+
]
78587858
}
78597859
]

vendor/twig/twig/CHANGELOG

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
* 1.22.3 (2015-10-13)
2+
3+
* fixed regression when using null as a cache strategy
4+
* improved performance when checking template freshness
5+
* fixed warnings when loaded templates do not exist
6+
* fixed template class name generation to prevent possible collisions
7+
* fixed logic for custom escapers to call them even on integers and null values
8+
* changed template cache names to take into account the Twig C extension
9+
110
* 1.22.2 (2015-09-22)
211

312
* fixed a race condition in template loading

vendor/twig/twig/doc/templates.rst

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -771,15 +771,27 @@ Other Operators
771771
.. versionadded:: 1.12.0
772772
Support for the extended ternary operator was added in Twig 1.12.0.
773773

774-
The following operators are very useful but don't fit into any of the other
775-
categories:
776-
777-
* ``..``: Creates a sequence based on the operand before and after the
778-
operator (this is just syntactic sugar for the :doc:`range<functions/range>`
779-
function).
774+
The following operators don't fit into any of the other categories:
780775

781776
* ``|``: Applies a filter.
782777

778+
* ``..``: Creates a sequence based on the operand before and after the operator
779+
(this is just syntactic sugar for the :doc:`range<functions/range>` function):
780+
781+
.. code-block:: jinja
782+
783+
{{ 1..5 }}
784+
785+
{# equivalent to #}
786+
{{ range(1, 5) }}
787+
788+
Note that you must use parentheses when combining it with the filter operator
789+
due to the :ref:`operator precedence rules <twig-expressions>`:
790+
791+
.. code-block:: jinja
792+
793+
(1..5)|join(', ')
794+
783795
* ``~``: Converts all operands into strings and concatenates them. ``{{ "Hello
784796
" ~ name ~ "!" }}`` would return (assuming ``name`` is ``'John'``) ``Hello
785797
John!``.

vendor/twig/twig/ext/twig/php_twig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef PHP_TWIG_H
1616
#define PHP_TWIG_H
1717

18-
#define PHP_TWIG_VERSION "1.22.2"
18+
#define PHP_TWIG_VERSION "1.22.3"
1919

2020
#include "php.h"
2121

vendor/twig/twig/lib/Twig/Cache/Filesystem.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function generateKey($name, $className)
3838
{
3939
$hash = hash('sha256', $className);
4040

41-
return $this->directory.'/'.$hash[0].'/'.$hash[1].'/'.$hash.'.php';
41+
return $this->directory.'/'.$hash[0].$hash[1].'/'.$hash.'.php';
4242
}
4343

4444
/**
@@ -87,6 +87,10 @@ public function write($key, $content)
8787
*/
8888
public function getTimestamp($key)
8989
{
90+
if (!file_exists($key)) {
91+
return 0;
92+
}
93+
9094
return (int) @filemtime($key);
9195
}
9296
}

vendor/twig/twig/lib/Twig/Environment.php

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
class Twig_Environment
1818
{
19-
const VERSION = '1.22.2';
19+
const VERSION = '1.22.3';
2020

2121
protected $charset;
2222
protected $loader;
@@ -48,6 +48,7 @@ class Twig_Environment
4848
private $originalCache;
4949
private $bcWriteCacheFile = false;
5050
private $bcGetCacheFilename = false;
51+
private $lastModifiedExtension = 0;
5152

5253
/**
5354
* Constructor.
@@ -263,6 +264,10 @@ public function setCache($cache)
263264
} elseif (false === $cache) {
264265
$this->originalCache = $cache;
265266
$this->cache = new Twig_Cache_Null();
267+
} elseif (null === $cache) {
268+
@trigger_error('Using "null" as the cache strategy is deprecated and will be removed in Twig 2.0.', E_USER_DEPRECATED);
269+
$this->originalCache = false;
270+
$this->cache = new Twig_Cache_Null();
266271
} elseif ($cache instanceof Twig_CacheInterface) {
267272
$this->originalCache = $this->cache = $cache;
268273
} else {
@@ -291,14 +296,22 @@ public function getCacheFilename($name)
291296
/**
292297
* Gets the template class associated with the given string.
293298
*
294-
* @param string $name The name for which to calculate the template class name
295-
* @param int $index The index if it is an embedded template
299+
* The generated template class is based on the following parameters:
300+
*
301+
* * The cache key for the given template;
302+
* * The currently enabled extensions;
303+
* * Whether the Twig C extension is available or not.
304+
*
305+
* @param string $name The name for which to calculate the template class name
306+
* @param int|null $index The index if it is an embedded template
296307
*
297308
* @return string The template class name
298309
*/
299310
public function getTemplateClass($name, $index = null)
300311
{
301-
$key = $this->getLoader()->getCacheKey($name).'__'.implode('__', array_keys($this->extensions));
312+
$key = $this->getLoader()->getCacheKey($name);
313+
$key .= json_encode(array_keys($this->extensions));
314+
$key .= function_exists('twig_template_get_attributes');
302315

303316
return $this->templateClassPrefix.hash('sha256', $key).(null === $index ? '' : '_'.$index);
304317
}
@@ -446,14 +459,7 @@ public function createTemplate($template)
446459
*/
447460
public function isTemplateFresh($name, $time)
448461
{
449-
foreach ($this->extensions as $extension) {
450-
$r = new ReflectionObject($extension);
451-
if (filemtime($r->getFileName()) > $time) {
452-
return false;
453-
}
454-
}
455-
456-
return $this->getLoader()->isFresh($name, $time);
462+
return $this->lastModifiedExtension <= $time && $this->getLoader()->isFresh($name, $time);
457463
}
458464

459465
/**
@@ -759,6 +765,11 @@ public function addExtension(Twig_ExtensionInterface $extension)
759765
throw new LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $extension->getName()));
760766
}
761767

768+
$r = new ReflectionObject($extension);
769+
if (($extensionTime = filemtime($r->getFileName())) > $this->lastModifiedExtension) {
770+
$this->lastModifiedExtension = $extensionTime;
771+
}
772+
762773
$this->extensions[$extension->getName()] = $extension;
763774
}
764775

vendor/twig/twig/lib/Twig/Extension.php

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,80 +11,62 @@
1111
abstract class Twig_Extension implements Twig_ExtensionInterface
1212
{
1313
/**
14-
* Initializes the runtime environment.
15-
*
16-
* This is where you can load some file that contains filter functions for instance.
17-
*
18-
* @param Twig_Environment $environment The current Twig_Environment instance
14+
* {@inheritdoc}
1915
*/
2016
public function initRuntime(Twig_Environment $environment)
2117
{
2218
}
2319

2420
/**
25-
* Returns the token parser instances to add to the existing list.
26-
*
27-
* @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
21+
* {@inheritdoc}
2822
*/
2923
public function getTokenParsers()
3024
{
3125
return array();
3226
}
3327

3428
/**
35-
* Returns the node visitor instances to add to the existing list.
36-
*
37-
* @return Twig_NodeVisitorInterface[] An array of Twig_NodeVisitorInterface instances
29+
* {@inheritdoc}
3830
*/
3931
public function getNodeVisitors()
4032
{
4133
return array();
4234
}
4335

4436
/**
45-
* Returns a list of filters to add to the existing list.
46-
*
47-
* @return array An array of filters
37+
* {@inheritdoc}
4838
*/
4939
public function getFilters()
5040
{
5141
return array();
5242
}
5343

5444
/**
55-
* Returns a list of tests to add to the existing list.
56-
*
57-
* @return array An array of tests
45+
* {@inheritdoc}
5846
*/
5947
public function getTests()
6048
{
6149
return array();
6250
}
6351

6452
/**
65-
* Returns a list of functions to add to the existing list.
66-
*
67-
* @return array An array of functions
53+
* {@inheritdoc}
6854
*/
6955
public function getFunctions()
7056
{
7157
return array();
7258
}
7359

7460
/**
75-
* Returns a list of operators to add to the existing list.
76-
*
77-
* @return array An array of operators
61+
* {@inheritdoc}
7862
*/
7963
public function getOperators()
8064
{
8165
return array();
8266
}
8367

8468
/**
85-
* Returns a list of global variables to add to the existing list.
86-
*
87-
* @return array An array of global variables
69+
* {@inheritdoc}
8870
*/
8971
public function getGlobals()
9072
{

vendor/twig/twig/lib/Twig/Extension/Core.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html',
10211021
if (!is_string($string)) {
10221022
if (is_object($string) && method_exists($string, '__toString')) {
10231023
$string = (string) $string;
1024-
} else {
1024+
} elseif (in_array($strategy, array('html', 'js', 'css', 'html_attr', 'url'))) {
10251025
return $string;
10261026
}
10271027
}

0 commit comments

Comments
 (0)