Commit Graph

3761 Commits

Author SHA1 Message Date
Fabien Potencier 89cbb5c4c9 optimized twig_get_attribute (avoid calling getSourceContext()) 2018-01-30 11:27:24 +01:00
Fabien Potencier d4482c9ab9 Merge branch '1.x' into 2.x
* 1.x:
  Update license year
  Update advanced.rst
2018-01-07 18:54:41 +01:00
Fabien Potencier 75baf9f897 minor #2611 Update license year (m1guelpf)
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes #2611).

Discussion
----------

Update license year

TO DO:

- [x] Wait to the next year (100% done, depends on timezone)
- [ ] Merge!

:octocat:

Commits
-------

012ca796 Update license year
2018-01-07 18:54:25 +01:00
Miguel Piedrafita 012ca796bf Update license year 2018-01-07 18:54:25 +01:00
Fabien Potencier b36e3eb452 minor #2598 Update advanced.rst (pfwd)
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes #2598).

Discussion
----------

Update advanced.rst

I noticed that the rot13Provider wasn't called correctly as it was trying to access a local variable instead of calling $this

Commits
-------

b42fd643 Update advanced.rst
2017-12-07 07:56:46 -08:00
Peter Fisher b42fd6435e Update advanced.rst
I noticed that the rot13Provider wasn't called correctly as it was trying to access a local variable instead of calling $this
2017-12-07 07:56:46 -08:00
Fabien Potencier 0b9a64d842 updated CHANGELOG 2017-11-12 10:48:08 -08:00
Fabien Potencier 6dc9d9e7d9 Merge branch '1.x' into 2.x
* 1.x:
  updated CHANGELOG
2017-11-12 10:47:55 -08:00
Fabien Potencier 5322c9b4ca updated CHANGELOG 2017-11-12 10:47:15 -08:00
Fabien Potencier 6019605609 Merge branch '1.x' into 2.x
* 1.x:
  Environment::resolveTemplate now accepts instances of TemplateWrapper
  Change typo in documentation
  fix grammar
2017-11-12 10:45:51 -08:00
Fabien Potencier 9c2b1dc528 bug #2586 Environment::resolveTemplate now accepts instances of TemplateWrapper (victorwelling)
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes #2586).

Discussion
----------

Environment::resolveTemplate now accepts instances of TemplateWrapper

The [documentation on the include function](https://twig.symfony.com/doc/2.x/functions/include.html) states (on the template expression):
> And if the expression evaluates to a Twig_Template or a Twig_TemplateWrapper instance, Twig will use it directly […]

This is currently broken, as `twig_include` [relies on `resolveTemplate`](https://github.com/twigphp/Twig/blob/31b577863b5ae8d19e2cefd174e95a433f16491f/lib/Twig/Extension/Core.php#L1304), which doesn't handle instances of `TemplateWrapper`. This PR fixes that.

For the sake of completeness: the `include` tag doesn't have this problem, as it relies on the `loadTemplate` method of the `Template` class which _does_ handle this case.

Commits
-------

78a4f2fb Environment::resolveTemplate now accepts instances of TemplateWrapper
2017-11-12 10:30:56 -08:00
Victor Welling 78a4f2fb59 Environment::resolveTemplate now accepts instances of TemplateWrapper 2017-11-12 10:30:50 -08:00
Fabien Potencier acfa0311e7 minor #2562 Change typo in documentation (uthopiko)
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes #2562).

Discussion
----------

Change typo in documentation

In example of use for test_iterable function there is a typo

Commits
-------

8607f13d Change typo in documentation
2017-11-12 10:27:33 -08:00
Asier Ramos 8607f13db7 Change typo in documentation
In example of use for test_iterable function there is a typo
2017-11-12 10:27:33 -08:00
Fabien Potencier 7014fda0af minor #2570 fix grammar (redbrickone)
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes #2570).

Discussion
----------

fix grammar

Commits
-------

d4309898 fix grammar
2017-11-12 10:24:46 -08:00
Chris Wright d430989818 fix grammar 2017-11-12 10:24:45 -08:00
Fabien Potencier 31b577863b Merge branch '1.x' into 2.x
* 1.x:
  Fix PHP 5.3 build
  bumped version to 1.35.1-DEV
  prepared the 1.35.0 release
2017-11-07 13:51:24 -08:00
Fabien Potencier 2610f2e128 minor #2582 Fix PHP 5.3 Travis build (c960657)
This PR was merged into the 1.x branch.

Discussion
----------

Fix PHP 5.3 Travis build

PHP 5.3 is only supported on Debian Precise.

Commits
-------

3a45bd48 Fix PHP 5.3 build
2017-11-07 13:50:11 -08:00
Christian Schmidt 3a45bd48cf Fix PHP 5.3 build 2017-11-07 22:28:59 +01:00
Fabien Potencier d8d888e2ae bumped version to 2.4.5-DEV 2017-09-27 11:11:00 -07:00
Fabien Potencier eddb97148a prepared the 2.4.4 release v2.4.4 2017-09-27 11:10:31 -07:00
Fabien Potencier a2ce3865a0 updated CHANGELOG 2017-09-27 11:09:40 -07:00
Fabien Potencier e7944a1f67 bumped version to 1.35.1-DEV 2017-09-27 11:07:18 -07:00
Fabien Potencier daa657073e prepared the 1.35.0 release v1.35.0 2017-09-27 11:06:46 -07:00
Fabien Potencier f26bc88dbc Merge branch '1.x' into 2.x
* 1.x:
  add throws tags doc block for Twig_Environment:load
2017-09-27 11:03:02 -07:00
Fabien Potencier 8a47e05b73 minor #2557 add throws tags doc block for Twig_Environment:load (Haehnchen)
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes #2557).

Discussion
----------

add throws tags doc block for Twig_Environment:load

On an internal project review we noticed that `\Twig_Environment::load` is not providing throw tags. As this method is just a proxy for `\Twig_Environment::loadTemplate` which itself is _internal_ we had some discussion around.

this PR provides same throw tags as _loadTemplate_. Maybe this helps to understand code usage

Commits
-------

882c7aab add throws tags doc block for Twig_Environment:load
2017-09-27 10:58:47 -07:00
Daniel Espendiller 882c7aab2a add throws tags doc block for Twig_Environment:load 2017-09-27 10:58:47 -07:00
Fabien Potencier 7588a040f3 updated CHANGELOG 2017-09-27 10:50:40 -07:00
Fabien Potencier c995b0594a Merge branch '1.x' into 2.x
* 1.x:
  added missing item in CHANGELOG
  Added pssibility to reset the profiler.
2017-09-27 10:50:04 -07:00
Fabien Potencier a726fc51bb added missing item in CHANGELOG 2017-09-27 10:48:29 -07:00
Fabien Potencier 70e735e39f feature #2560 Added pssibility to reset the profiler (derrabus)
This PR was merged into the 1.x branch.

Discussion
----------

Added pssibility to reset the profiler

In order to implement symfony/symfony#18244 properly, I needed the ability to reset a Twig profile.

Commits
-------

ea922bb6 Added pssibility to reset the profiler.
2017-09-27 10:47:04 -07:00
Fabien Potencier 4d7d034791 minor #2556 µoptim for twig_get_attribute() (nicolas-grekas)
This PR was merged into the 2.x branch.

Discussion
----------

µoptim for twig_get_attribute()

We don't need the cache when checking for arrays.

Commits
-------

93bee55d µoptim for twig_get_attribute()
2017-09-27 10:25:30 -07:00
Alexander M. Turek ea922bb6eb Added pssibility to reset the profiler. 2017-09-22 16:29:04 +02:00
Nicolas Grekas 93bee55d33 µoptim for twig_get_attribute() 2017-09-18 09:24:22 +02:00
Fabien Potencier 103cae817d updated CHANGELOG 2017-08-19 19:43:10 +02:00
Fabien Potencier e9a1f916e2 Merge branch '1.x' into 2.x
* 1.x:
  ensured that the use TokenParser returns a node instance
  fixed CS
  simplified tests as min version if now 5.3.3
  bumped version to 1.35
  show how to use a variable as hash map key
  Added RuntimeExtensionInterface
2017-08-19 19:42:41 +02:00
Fabien Potencier cd06d3c696 bug #2543 Ensure that the "use" TokenParser returns a node instance (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Ensure that the "use" TokenParser returns a node instance

Alternative to #2539, fixes #2538.

Commits
-------

421d8722 ensured that the use TokenParser returns a node instance
2017-08-19 19:37:14 +02:00
Fabien Potencier 421d8722f0 ensured that the use TokenParser returns a node instance 2017-08-19 19:36:32 +02:00
Fabien Potencier 96f1a5b486 minor #2544 simplified tests as min version if now 5.3.3 (fabpot)
This PR was squashed before being merged into the 1.x branch (closes #2544).

Discussion
----------

simplified tests as min version if now 5.3.3

fixes #2526

Commits
-------

a3548a6e fixed CS
90a07d16 simplified tests as min version if now 5.3.3
2017-08-16 09:28:55 +02:00
Fabien Potencier a3548a6e23 fixed CS 2017-08-16 08:33:11 +02:00
Fabien Potencier 90a07d166d simplified tests as min version if now 5.3.3 2017-08-16 08:30:52 +02:00
Fabien Potencier 02042e5126 feature #2519 Added RuntimeExtensionInterface (lyrixx)
This PR was merged into the 1.x branch.

Discussion
----------

Added RuntimeExtensionInterface

Commits
-------

6f08f574 Added RuntimeExtensionInterface
2017-08-16 08:19:23 +02:00
Fabien Potencier 16bfb101f0 bumped version to 1.35 2017-08-16 08:18:33 +02:00
Fabien Potencier 73ab3a1215 minor #2536 show how to use a variable as hash map key (tolry)
This PR was submitted for the 2.x branch but it was squashed and merged into the 1.x branch instead (closes #2536).

Discussion
----------

show how to use a variable as hash map key

currently the documentation does not explain how it's possible to use a variable as key in a hash map

Commits
-------

ef6c9505 show how to use a variable as hash map key
2017-08-02 20:11:46 +02:00
Tobias Olry ef6c950505 show how to use a variable as hash map key 2017-08-02 20:11:29 +02:00
Grégoire Pineau 6f08f5745c Added RuntimeExtensionInterface 2017-07-22 11:19:18 +02:00
Fabien Potencier 5ee1d1884f updated CHANGELOG 2017-07-22 09:33:53 +02:00
Fabien Potencier 198a98b1df Merge branch '1.x' into 2.x
* 1.x:
  updated CHANGELOG
  Throw exception on circular reference detection
2017-07-22 09:33:34 +02:00
Fabien Potencier 6e17134b1a updated CHANGELOG 2017-07-22 09:30:43 +02:00
Fabien Potencier d632fd3c33 feature #2530 Throw exception on circular reference detection (yceruto)
This PR was merged into the 1.x branch.

Discussion
----------

Throw exception on circular reference detection

Out-the-box this isn't common... but into Symfony framework this kind of issue can happen frequently when we're overriding a template from third-party bundle (see main issue https://github.com/symfony/symfony/issues/17557)

```twig
{# app/Resources/AcmeBlogBundle/views/Blog/index.html.twig #}
{% extends '@AcmeBlog/Blog/index.html.twig' %}

{% block title 'New Title' %}
```

This exception avoids inifite loop or maximum execution time for this case, by detecting a recursive loading when a template extends from itself, thinking to override the parent template which has the same namespace + template name.

Commits
-------

074e1fbe Throw exception on circular reference detection
2017-07-22 09:30:00 +02:00