Commit Graph

3161 Commits

Author SHA1 Message Date
SpacePossum 61d31c8fef Fix typo. 2017-01-19 14:08:47 +01:00
Fabien Potencier 9b3796b140 bumped version to 1.31.1-DEV 2017-01-11 11:37:33 -08:00
Fabien Potencier ddc9e3e20e prepared the 1.31.0 release v1.31.0 2017-01-11 11:36:15 -08:00
Fabien Potencier c9a14464a3 added a note about macros usage in the deprecated docs 2017-01-11 11:20:42 -08:00
Fabien Potencier feb9bf539f bug #2354 Turned fatal error into exception when a previously generated cache prevents loading its newly compiled version (nicolas-grekas)
This PR was merged into the 1.x branch.

Discussion
----------

Turned fatal error into exception when a previously generated cache prevents loading its newly compiled version

Not sure if this is testable, yet this should save some hours to people that end up in the same trap we did on our project.
It turned out we generated some twig template cache in two separate commands, in a situation where "index" tracking for embeds where lost.

This PR detects the situation and invites to clear the cache properly, because that's the only way to fix the issue.

It also fixes a mistake in the cache $key generation, that should not take $index into account.
Doing so were making offline cache warmup useless in some situations.

Commits
-------

95c10991 Turned fatal error into exception when a previously generated cache prevents loading its newly compiled version
2017-01-11 08:01:13 -08:00
Nicolas Grekas 95c109919a Turned fatal error into exception when a previously generated cache prevents loading its newly compiled version 2017-01-11 16:22:32 +01:00
Fabien Potencier 4e1c232b67 removed years in (c) in files (we have them in the referenced main LICENSE file) 2017-01-10 14:14:10 -08:00
Fabien Potencier 0f9f76a17b updated CHANGELOG 2017-01-10 14:04:11 -08:00
Fabien Potencier 44eba84e24 fixed typo 2017-01-10 14:02:12 -08:00
Fabien Potencier 751c05bddd feature #2341 feature #2045 Adds Twig_NodeCaptureInterface for nodes that capture all output (brandonkelly)
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes #2341).

Discussion
----------

feature #2045 Adds Twig_NodeCaptureInterface for nodes that capture all output

This implements the feature originally suggested by #2045, but specifically in the manner suggested by #2340, which I think is more consistent with existing Twig code.

Commits
-------

bc6a9133 feature #2045 Adds Twig_NodeCaptureInterface for nodes that capture all output
2017-01-10 14:01:09 -08:00
brandonkelly bc6a91335d feature #2045 Adds Twig_NodeCaptureInterface for nodes that capture all output 2017-01-10 14:01:09 -08:00
Fabien Potencier 3cdbd325d4 bumped version to 1.31.0 2017-01-10 14:00:36 -08:00
Fabien Potencier d192cdce8c bug #2345 Delay marking the environment as initialized until it is done (stof)
This PR was merged into the 1.x branch.

Discussion
----------

Delay marking the environment as initialized until it is done

This avoids breaking the symfony exception page rendering saying that filters are not available due to a partial initialization: https://github.com/symfony/symfony/issues/21212
It would report the initialization error instead.

Commits
-------

a33fb6ce Delay marking the environment as initialized until it is done
2017-01-09 12:28:52 -08:00
Christophe Coevoet a33fb6ce2c Delay marking the environment as initialized until it is done 2017-01-09 17:10:34 +01:00
Fabien Potencier 94acd37011 minor #2330 Fix the argument name of filter replace (jean-pasqualini)
This PR was merged into the 1.x branch.

Discussion
----------

Fix the argument name of filter replace

The argument name in the code is $from

See https://github.com/jean-pasqualini/Twig/blob/1.x/lib/Twig/Extension/Core.php#L475.

Issue : https://github.com/twigphp/Twig/issues/2329

Commits
-------

c8f69d76 Fix the argument name of filter replace
2017-01-05 11:55:35 -08:00
Jean pasqualini c8f69d764b Fix the argument name of filter replace
The argument name in the code is $from

See https://github.com/jean-pasqualini/Twig/blob/1.x/lib/Twig/Extension/Core.php#L475.

Issue : https://github.com/twigphp/Twig/issues/2329
2017-01-05 18:35:52 +01:00
Fabien Potencier cfd709b16e tweaked PHP CS Fixer rules 2017-01-04 14:05:59 -08:00
Fabien Potencier 4528cc717d updated copyright year 2017-01-02 12:22:20 -08:00
Fabien Potencier 5d1f37c881 minor #2322 Minor typo in class name (BenjaminPaap)
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes #2322).

Discussion
----------

Minor typo in class name

Commits
-------

ce90852 Minor typo in class name
2016-12-29 22:21:24 +01:00
Benjamin Paap ce90852541 Minor typo in class name 2016-12-29 22:21:24 +01:00
Fabien Potencier 91938100bb fixed CS 2016-12-27 11:58:11 +01:00
Fabien Potencier 289dad5898 minor #2265 Optimize usage of Traversable/Iterator (SpacePossum)
This PR was squashed before being merged into the 1.x branch (closes #2265).

Discussion
----------

Optimize usage of Traversable/Iterator

Commits
-------

2bdcfb6 Optimize usage of Traversable/Iterator
2016-12-27 11:56:08 +01:00
SpacePossum 2bdcfb6743 Optimize usage of Traversable/Iterator 2016-12-27 11:56:06 +01:00
Fabien Potencier 5268900793 minor #2319 Fix typo in phpdoc (chalasr)
This PR was merged into the 1.x branch.

Discussion
----------

Fix typo in phpdoc

Commits
-------

6a720ab Fix typo in phpdoc
2016-12-26 08:10:59 +01:00
Robin Chalas 6a720ab263 Fix typo in phpdoc 2016-12-25 11:15:02 +01:00
Fabien Potencier ae05130032 bug #2317 fix C89 compat (Jan-E)
This PR was merged into the 1.x branch.

Discussion
----------

fix C89 compat

@tucksaun @fabpot The extension did not compile anymore with old MSVC compilers. This PR contains the fix.

Commits
-------

c6be57f fix C89 compat
2016-12-24 11:35:17 +01:00
Fabien Potencier b42bacec7f fixed composer.json 2016-12-24 09:07:02 +01:00
Jan-E c6be57f903 fix C89 compat 2016-12-24 06:16:32 +01:00
Fabien Potencier 2cbc573aa5 bumped version to 1.30.1-DEV 2016-12-23 12:16:08 +01:00
Fabien Potencier c6ff71094f prepared the 1.30.0 release v1.30.0 2016-12-23 12:06:22 +01:00
Fabien Potencier 72762d6c2c fixed CS 2016-12-23 09:12:13 +01:00
Fabien Potencier d9e56ac6ac updated CHANGELOG 2016-12-23 09:11:24 +01:00
Fabien Potencier 2fd05fdd05 feature #2311 Add a simple Twig_RuntimeLoaderInterface implementation (chalasr)
This PR was merged into the 1.x branch.

Discussion
----------

Add a simple Twig_RuntimeLoaderInterface implementation

Next to https://github.com/symfony/symfony/pull/21023

This is related to the BC break reported in symfony/symfony#21008 which has been introduced in symfony/symfony#20093 when decoupling extensions from definitions.

What I propose here is to ease the upgrade to symfony 3.2+ by adding a simple `Twig_RuntimeLoaderInterface` implementation here, useful only when using the twig-bridge outside of the symfony fullstack framework (with the Form component for instance).

Upgrading would be as simple as:

```diff
$twig = new Twig_Environment(...);
$rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'), $twig);
- $twig->addExtension(new FormExtension(new TwigRenderer($rendererEngine, $csrfTokenManager)));
+ $twig->addExtension(new FormExtension());
+ $twig->addRuntimeLoader(new Twig_RuntimeLoader(array(TwigRenderer::class => new TwigRenderer($rendererEngine, $csrfTokenManager)));
```

Instead of having to write this runtime loader yourself.
Please see symfony/symfony#21008 for details and a concrete example of how this could help.

Commits
-------

91c8d59 Add a Twig_FactoryRuntimeLoader
2016-12-23 09:11:01 +01:00
Fabien Potencier 0457888fc3 added more final classes 2016-12-23 09:05:03 +01:00
Fabien Potencier 3824a4c2b7 minor #2314 add a comma to clarify the meaning (xabbuh)
This PR was merged into the 1.x branch.

Discussion
----------

add a comma to clarify the meaning

Without the comma you could understand that the "if" not only applied
to `-1`, but to `1` as well if you read too quickly.

Commits
-------

7cd3c9d add a comma to clarify the meaning
2016-12-23 08:57:59 +01:00
Christian Flothmann 7cd3c9d25f add a comma to clarify the meaning
Without the comma you could understand that the "if" not only applied
to `-1`, but to `1` as well if you read too quickly.
2016-12-23 08:52:50 +01:00
Fabien Potencier c88edc8c75 removed unnneeded phpdocs 2016-12-23 08:09:25 +01:00
Fabien Potencier 97a8c53ec6 tweaked a deprecation notice 2016-12-23 07:51:44 +01:00
Fabien Potencier 40348480e7 added more docs about the range function 2016-12-23 07:21:48 +01:00
Robin Chalas 91c8d59978 Add a Twig_FactoryRuntimeLoader 2016-12-23 01:04:02 +01:00
Fabien Potencier 9b31db1ee6 minor #2308 added PHP CS Fixer config (fabpot)
This PR was squashed before being merged into the 1.x branch (closes #2308).

Discussion
----------

added PHP CS Fixer config

Commits
-------

aa9604a added PHP CS Fixer config
aa71a65 fixed CS
2016-12-22 13:16:28 +01:00
Fabien Potencier aa9604aad1 added PHP CS Fixer config 2016-12-22 13:07:38 +01:00
Fabien Potencier aa71a65f11 fixed CS 2016-12-22 13:04:37 +01:00
Fabien Potencier c33628267e feature #2304 deprecate function/test/filter/tag overriding (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

deprecate function/test/filter/tag overriding

closes #2293

Commits
-------

7ffb188 deprecated function/test/filter/tag overriding
2016-12-20 05:02:06 +01:00
Fabien Potencier 7ffb188710 deprecated function/test/filter/tag overriding 2016-12-20 04:58:45 +01:00
Fabien Potencier 9dd38e29e3 feature #2303 deprecate the "disable_c_ext" attribute on Twig_Node_Expression_GetAttr (fabpot, tucksaun)
This PR was merged into the 1.x branch.

Discussion
----------

deprecate the "disable_c_ext" attribute on Twig_Node_Expression_GetAttr

Commits
-------

c215966 Sync PHP ext with PHP code to trigger deprecations
014ab1f deprecated the "disable_c_ext" attribute on Twig_Node_Expression_GetAttr
2016-12-19 14:18:22 +01:00
Tugdual Saunier c215966a9e Sync PHP ext with PHP code to trigger deprecations 2016-12-19 14:02:16 +01:00
Fabien Potencier 014ab1f8e1 deprecated the "disable_c_ext" attribute on Twig_Node_Expression_GetAttr 2016-12-17 21:04:25 +01:00
Fabien Potencier 7478b58b3d minor #2300 removed ltrim because $class variable already ltrim'ed (sapogov.n)
This PR was merged into the 1.x branch.

Discussion
----------

removed ltrim because $class variable already ltrim'ed

removed ltrim because $class variable already ltrim'ed

Commits
-------

3badb14 removed ltrim because $class variable already ltrim'ed
2016-12-16 17:06:44 +01:00
sapogov.n 3badb14147 removed ltrim because $class variable already ltrim'ed 2016-12-16 18:25:29 +03:00