Commit Graph

3037 Commits

Author SHA1 Message Date
Fabien Potencier c19448545a minor #2241 added some more tests (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

added some more tests

Commits
-------

b23cc3b added some more tests
2016-11-11 13:49:36 -08:00
Fabien Potencier 1c2bec9112 feature #2242 added 'is defined' support for constant (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

added 'is defined' support for constant

Commits
-------

c81bae4 added 'is defined' support for constant
2016-11-11 13:49:19 -08:00
Fabien Potencier b23cc3b4a1 added some more tests 2016-11-11 13:45:13 -08:00
Fabien Potencier c81bae489e added 'is defined' support for constant 2016-11-11 13:40:51 -08:00
Fabien Potencier 0d6581bf64 feature #2239 Add "is defined" support for block() (hason, fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Add "is defined" support for block()

replaces #1831, fixes #1821

I think reusing the semantic of the `defined` test is more idiomatic and easily discoverable.

/cc @hason

Commits
-------

3ce06af added 'is defined' support for block()
4f013e0 Add test to check if a block exists
2016-11-11 12:08:12 -08:00
Fabien Potencier 3ce06af6b4 added 'is defined' support for block() 2016-11-11 12:03:32 -08:00
Martin Hasoň 4f013e09ea Add test to check if a block exists 2016-11-11 12:02:25 -08:00
Fabien Potencier c577631f39 minor #2240 removed old code that is not needed anymore (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

removed old code that is not needed anymore

Commits
-------

60bed59 removed old code that is not needed anymore
2016-11-11 11:59:57 -08:00
Fabien Potencier 60bed59266 removed old code that is not needed anymore 2016-11-11 11:38:25 -08:00
Fabien Potencier 9cede85c5f minor #2234 removed some unneeded phpdocs (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

removed some unneeded phpdocs

Commits
-------

f21c44c removed some unneeded phpdocs
2016-11-11 08:37:49 -08:00
Fabien Potencier fc53b5ab18 bug #2237 added a proper error message when block() is called without arguments (fabpot)
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
2016-11-11 07:07:12 -08:00
Fabien Potencier a63ee7c6fb added a proper error message when block() is called without arguments 2016-11-10 21:27:25 -08:00
Fabien Potencier f21c44cd67 removed some unneeded phpdocs 2016-11-10 13:24:47 -08:00
Fabien Potencier 924c2f4813 updated CHANGELOG 2016-11-10 11:30:21 -08:00
Fabien Potencier 81a174ff6c feature #2228 Enhance perf of Template::getAttribute() (nicolas-grekas)
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()
2016-11-10 11:29:27 -08:00
Fabien Potencier d630f870a7 bumped version to 1.28 2016-11-10 11:28:46 -08:00
Fabien Potencier 61f840c85f minor #2231 Remove Xdebug for tests (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Remove Xdebug for tests

Commits
-------

498dcf4 removed Xdebug on Travis
2016-11-10 11:24:03 -08:00
Fabien Potencier 224deeb3e9 minor #2232 Add testing PHP 7.1 (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Add testing PHP 7.1

Commits
-------

56e09fb added testing PHP 7.1
2016-11-10 11:23:51 -08:00
Fabien Potencier 56e09fb7d3 added testing PHP 7.1 2016-11-10 11:15:19 -08:00
Nicolas Grekas bdbfb15111 Enhance perf of Template::getAttribute() 2016-11-10 19:43:25 +01:00
Fabien Potencier 1c99469bcc minor #2227 added a note about the default escaping strategy (fabpot)
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
2016-11-10 10:28:59 -08:00
Fabien Potencier 56556d72f8 added a note about the default escaping strategy 2016-11-10 10:28:06 -08:00
Fabien Potencier dc3533c347 fixed typo 2016-11-08 12:40:21 -08:00
Fabien Potencier b37db3bc93 bug #2216 Load templates from cache, even if they have just been compiled (mpdude)
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
2016-11-07 19:10:29 -08:00
Matthias Pigulla ff0abbb7e8 Load templates from cache, even if they have just been compiled 2016-11-07 19:10:26 -08:00
Fabien Potencier 3314cd546e minor #2214 Allow construction without constructor arguments (gnat42)
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
2016-11-07 11:42:43 -08:00
Fabien Potencier c575ff2119 minor #2222 add machine-readable version constants (xabbuh)
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
2016-11-07 11:37:58 -08:00
Christian Flothmann bf07db4f13 add machine-readable version constants 2016-11-07 19:49:36 +01:00
Nathanael Noblet 289f63c258 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.
2016-11-01 13:44:13 -06:00
Fabien Potencier eeeb1c35f8 minor #2209 Fixing wrong function name in deprecation notice (kubawerlos)
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
2016-10-28 07:39:51 -07:00
Kuba Werłos 0a3d3c7ce1 Fixing wrong function name in deprecation notice 2016-10-28 15:26:19 +02:00
Fabien Potencier 3ff5abf75b bumped version to 1.27.1-DEV 2016-10-25 12:28:14 -07:00
Fabien Potencier 3c6c0033fd prepared the 1.27.0 release v1.27.0 2016-10-25 12:17:17 -07:00
Fabien Potencier 5e396e559d fixed undefined variables 2016-10-25 10:31:00 -07:00
Fabien Potencier 2555dd009c feature #2206 Move tests handling in Twig_ParserExpression instead of Twig_Extension_Core (fabpot)
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
2016-10-24 16:48:00 -07:00
Fabien Potencier 4deb03aeb1 deprecated Twig_Parser::getEnvironment() 2016-10-24 16:37:44 -07:00
Fabien Potencier 0d6686ec30 moved tests handling in Twig_ParserExpression instead of Twig_Extension_Core 2016-10-24 16:37:28 -07:00
Fabien Potencier 9cab8b9f37 feature #2202 deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor() (fabpot)
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()
2016-10-24 08:26:26 -07:00
Fabien Potencier cefaecfc38 feature #2203 deprecated Twig_Compiler::addIndentation() (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

deprecated Twig_Compiler::addIndentation()

Commits
-------

bc499a4 deprecated Twig_Compiler::addIndentation()
2016-10-24 08:25:31 -07:00
Fabien Potencier bc499a47e1 deprecated Twig_Compiler::addIndentation() 2016-10-23 22:44:52 -07:00
Fabien Potencier 7e5c06a3be added a note about when to remove a workaround 2016-10-23 14:24:54 -07:00
Fabien Potencier 31c444b511 deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor() 2016-10-23 13:50:47 -07:00
Fabien Potencier c97f3b85c3 bug #2200 fixed regression when registering two extensions with the same class (fabpot)
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
2016-10-23 13:13:39 -07:00
Fabien Potencier 47432f3244 fixed regression when registering two extensions having the same class name 2016-10-23 13:11:53 -07:00
Fabien Potencier 09bf2bae50 removed unneeded abstraction 2016-10-21 20:23:53 -07:00
Fabien Potencier d6e60740d9 added missing phpdoc 2016-10-21 17:19:12 -07:00
Fabien Potencier e98816cfd4 feature #2199 make getSourceContext a requirement for any loader (fabpot)
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
2016-10-21 17:15:21 -07:00
Fabien Potencier 21ecba8c44 made using Twig_SourceContextLoaderInterface required 2016-10-21 17:07:14 -07:00
Fabien Potencier 8c337082bb made name required for Twig_Source 2016-10-21 16:09:51 -07:00
Fabien Potencier fbf1391cbd feature #2195 fixed the filesystem loader with relative paths (fabpot)
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
2016-10-21 07:02:50 -07:00