This PR was merged into the 1.x branch.
Discussion
----------
added a proper error message when block() is called without arguments
Commits
-------
a63ee7c added a proper error message when block() is called without arguments
This PR was merged into the 1.x branch.
Discussion
----------
Enhance perf of Template::getAttribute()
Note that this is unproved statement for now :)
If someone has a benchmark and want to try, please do (and share results).
Commits
-------
bdbfb15 Enhance perf of Template::getAttribute()
This PR was merged into the 1.x branch.
Discussion
----------
added a note about the default escaping strategy
fixes#2061
Commits
-------
56556d7 added a note about the default escaping strategy
This PR was squashed before being merged into the 1.x branch (closes#2216).
Discussion
----------
Load templates from cache, even if they have just been compiled
Previously, when the cache was empty, the compiled template would be written to it, but `eval()`d from `$content`. In that case, it is not possible to step through (read: debug) the compiled template because at least xDebug does not have a clue where the code comes from.
With this change, PHP/xDebug can tell even on the first run (with an empty cache) where the code was loaded from.
Commits
-------
ff0abbb Load templates from cache, even if they have just been compiled
This PR was merged into the 1.x branch.
Discussion
----------
Allow construction without constructor arguments
Since we can dynamically add templates and its possible to not need to construct the loader without any initial templates. I've added the default argument to the constructor for simpler instantiation IE new Twig_Loader_Array();. This helps us on a project where we've extended the loader, and have no initial templates but need to add constructor parameters for no real reason.
Commits
-------
289f63c Allow construction without constructor arguments
This PR was merged into the 1.x branch.
Discussion
----------
add machine-readable version constants
This will make it easier to implement version depending features (see https://github.com/symfony/symfony/pull/20440#discussion_r86840491 for an example).
Commits
-------
bf07db4 add machine-readable version constants
Since we can dynamically add templates and its possible to not need to construct the loader without any initial templates. I've added the default argument to the constructor for simpler instantiation IE new Twig_Loader_Array();. This helps us on a project where we've extended the loader, and have no initial templates but need to add constructor parameters for no real reason.
This PR was merged into the 1.x branch.
Discussion
----------
Fixing wrong function name in deprecation notice
Commits
-------
0a3d3c7 Fixing wrong function name in deprecation notice
This PR was merged into the 1.x branch.
Discussion
----------
Move tests handling in Twig_ParserExpression instead of Twig_Extension_Core
In my quest to better organize the layers in Twig, I've always find the way we deal with test a bit awkward. This PR moves the code from the Core extension to the Parser, where it belongs, even if if makes hardcoding 'is' and 'is not' twice, but I think SOC is more important here. Especially as I want to remove the `getEnvironment()` from the Parser class at some point. Having everything centralized helps a lot.
Commits
-------
4deb03a deprecated Twig_Parser::getEnvironment()
0d6686e moved tests handling in Twig_ParserExpression instead of Twig_Extension_Core
This PR was merged into the 1.x branch.
Discussion
----------
deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor()
I don't even understand why these methods are here. It looks like they never had any usage in the core.
Commits
-------
31c444b deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor()
This PR was merged into the 1.x branch.
Discussion
----------
deprecated Twig_Compiler::addIndentation()
Commits
-------
bc499a4 deprecated Twig_Compiler::addIndentation()
This PR was merged into the 1.x branch.
Discussion
----------
fixed regression when registering two extensions with the same class
fixed#2165
Commits
-------
47432f3 fixed regression when registering two extensions having the same class name
This PR was merged into the 1.x branch.
Discussion
----------
make getSourceContext a requirement for any loader
I'm going to follow the same protocol as for `Twig_ExistsLoaderInterface`.
Commits
-------
21ecba8 made using Twig_SourceContextLoaderInterface required
8c33708 made name required for Twig_Source
This PR was merged into the 1.x branch.
Discussion
----------
fixed the filesystem loader with relative paths
closes#2145
TODO
- [x] document the new `$rootPath` option
- [x] add test with a `$rootPath` different from `getcwd()`
- [x] test the cache key does not vary when `$rootPath` changes
Commits
-------
a343c92 fixed the filesystem loader with relative paths
This PR was merged into the 1.x branch.
Discussion
----------
deprecated not supported behavior
Commits
-------
b38f959 deprecated not supported behavior
This PR was merged into the 1.x branch.
Discussion
----------
rename Twig_Node::getName to getTemplateName and Twig_Node::getFile to getTemplateLine
Commits
-------
39d94df renamed Twig_Node::getLine() to Twig_Node::getTemplateLine()
e231aa5 renamed Twig_Node::getName() to Twig_Node::getTemplateName()