Commit Graph

2601 Commits

Author SHA1 Message Date
Christophe Coevoet cb98576934 Add missing deprecation triggers 2015-08-20 11:31:45 +02:00
Fabien Potencier 92fa52b874 bug #1775 Fix the deprecation warning for functions and tests (stof)
This PR was merged into the 1.x branch.

Discussion
----------

Fix the deprecation warning for functions and tests

Otherwise, when a function does not define any filter, the message looks like that:

```
Using an instance of "Twig_Environment" for function "nelmio_js_logger" is deprecated. Use Twig_SimpleFunction instead.
```

This happens because the notice about the undefined variable gets silenced too, and ``get_class(null)`` returns the current class.

Commits
-------

1687097 Fix the deprecation warning for functions and tests
2015-08-19 23:10:59 +02:00
Christophe Coevoet 1687097ed0 Fix the deprecation warning for functions and tests 2015-08-19 15:19:42 +02:00
Fabien Potencier d4aa0238c3 bumped version to 1.21 2015-08-18 15:28:19 +02:00
Fabien Potencier 4cb0704e07 avoid a PHPUnit message when no legacy tests are in the test suite 2015-08-18 15:15:46 +02:00
Fabien Potencier 05b5f80d4a simplified tests 2015-08-18 14:33:40 +02:00
Fabien Potencier 5fdbd991bf feature #1769 Deprecation notices (fabpot, nicolas-grekas)
This PR was merged into the 1.x branch.

Discussion
----------

Deprecation notices

Added a way to warn our users of deprecation features. This framework can be used for core features, but also for functions/tests/filters created by third-party. I haven't added something for tags as it can be done easily in the token parser class.

Fixes #1756 and #1767

Commits
-------

56c7382 added Twig_Util_DeprecationCollector to collect deprecation notices for a set of templates
2da6bae tweaked some deprecation messages
cc98028 added deprecation notices for deprecated classes
c6ab7de optimized legacy tests management
eebfdc7 added a way to manage legacy tests in fixtures
8c4291a removed usage of deprecated features, marked some tests as being legacy
b5db9dc added the Symfony PHPUnit bridge to better manage deprecation notices
23c3922 added deprecated notices for deprecated features
bd87ba8 added some documentation about deprecation notices
d16b7bf added a way to trigger deprecation notices for filters and functions
21f536b added deprecation for the raw tag
efcfe8e added deprecation notices for deprecated tests
65e70a2 fixed CS
2015-08-18 14:05:39 +02:00
Fabien Potencier 56c7382775 added Twig_Util_DeprecationCollector to collect deprecation notices for a set of templates 2015-08-18 13:34:47 +02:00
Fabien Potencier 2da6baee63 tweaked some deprecation messages 2015-08-18 13:34:47 +02:00
Fabien Potencier cc980282de added deprecation notices for deprecated classes 2015-08-18 13:34:47 +02:00
Nicolas Grekas c6ab7de8f2 optimized legacy tests management 2015-08-18 13:34:47 +02:00
Fabien Potencier eebfdc75f1 added a way to manage legacy tests in fixtures 2015-08-18 13:34:47 +02:00
Fabien Potencier 8c4291ac08 removed usage of deprecated features, marked some tests as being legacy 2015-08-18 13:34:47 +02:00
Fabien Potencier b5db9dc5f2 added the Symfony PHPUnit bridge to better manage deprecation notices 2015-08-18 13:34:47 +02:00
Fabien Potencier 23c392212e added deprecated notices for deprecated features 2015-08-18 13:34:46 +02:00
Fabien Potencier bd87ba8ad0 added some documentation about deprecation notices 2015-08-18 13:34:46 +02:00
Fabien Potencier d16b7bf0a7 added a way to trigger deprecation notices for filters and functions 2015-08-18 09:47:53 +02:00
Fabien Potencier 21f536bc0a added deprecation for the raw tag 2015-08-18 09:47:53 +02:00
Fabien Potencier efcfe8e0d7 added deprecation notices for deprecated tests 2015-08-18 09:47:53 +02:00
Fabien Potencier 65e70a2c87 fixed CS 2015-08-17 21:43:54 +02:00
Fabien Potencier 5f253f77a8 minor #1772 Optimize the retrieval of reserved macro names (stof)
This PR was merged into the 1.x branch.

Discussion
----------

Optimize the retrieval of reserved macro names

The list of reserved names does not need to be reset for each template compilation.

Commits
-------

c267257 Optimize the retrieval of reserved macro names
2015-08-17 21:42:30 +02:00
Fabien Potencier 66c32e0974 minor #1770 Remove dead code (stof)
This PR was merged into the 1.x branch.

Discussion
----------

Remove dead code

Array keys cannot be objects in PHP.

Commits
-------

a07ac6a Remove dead code
2015-08-17 21:41:22 +02:00
Christophe Coevoet c267257ccf Optimize the retrieval of reserved macro names
The list of reserved names does not need to be reset for each template
compilation.
2015-08-17 11:47:30 +02:00
Christophe Coevoet a07ac6a0a8 Remove dead code
Array keys cannot be objects in PHP.
2015-08-17 11:33:49 +02:00
Fabien Potencier c27b04c9d6 added the raw tag as being deprecated 2015-08-15 23:53:21 +02:00
Fabien Potencier 39885c9140 replaced obsolete raw tag by verbatim in tests 2015-08-15 23:50:57 +02:00
Fabien Potencier 499d4e7d60 bug #1763 Remove broken code (stof)
This PR was merged into the 1.x branch.

Discussion
----------

Remove broken code

https://github.com/twigphp/Twig/commit/651613c32c315bbeb330b2a6354b34c288e9ea0a#diff-841d1051670799376e88c87114d2caf0 broke the code of ``Twig_Node_Module::compileLoadTemplate`` when passing a non-constant node (it triggers a fatal error)
Trait templates can only be constant expression nodes, so fixing the broken is not actually needed and it can be removed.
Given it is a protected method, I haven't changed the signature to typehint the node as a Twig_Node_Expression_Constant

Commits
-------

e6ae0d0 Remove broken code
2015-08-15 21:53:40 +02:00
Fabien Potencier af129b2f75 fixed typos and CS 2015-08-13 14:50:40 +02:00
Fabien Potencier 5f5d8b0647 minor #1762 [doc/recipes] Added OPcache support (iKwinto)
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes #1762).

Discussion
----------

[doc/recipes] Added OPcache support

OPcache enabled by default cache sinse PHP 5.5.

Commits
-------

1f3fb9a [doc/recipes] Added OPcache support
2015-08-13 14:49:08 +02:00
Alexander Vasilyev 1f3fb9a178 [doc/recipes] Added OPcache support 2015-08-13 14:49:08 +02:00
Christophe Coevoet e6ae0d0caa Remove broken code
Trait templates can only be constant expression nodes, so fixing the
broken is not actually needed and it can be removed.
2015-08-13 10:32:03 +02:00
Fabien Potencier 37553291e6 bumped version to 1.20.1-DEV 2015-08-12 18:01:39 +02:00
Fabien Potencier 1ea4e5f81c prepared the 1.20.0 release v1.20.0 2015-08-12 17:56:39 +02:00
Fabien Potencier 8b5ac1c86b security #1759 Some various changes (fabpot, stof, tucksaun)
This PR was merged into the 1.x branch.

Discussion
----------

Some various changes

Commits
-------

e5b7c03 updated CHANGELOG
2250060 Fix the accessibility of Twig_Template::getEnvironment method in the C ext
e000420 Fix the handling of internal Twig_Template properties in the C ext
a8a125b Forbid access to the Twig environment from template instance
30be077 fixed sandbox security issue
7b6c0e9 Prevent importing or calling reserved macro names
2015-08-12 17:53:26 +02:00
Fabien Potencier e5b7c0359d updated CHANGELOG 2015-08-12 17:44:22 +02:00
Tugdual Saunier 22500609b6 Fix the accessibility of Twig_Template::getEnvironment method in the C ext 2015-08-12 17:44:05 +02:00
Christophe Coevoet e000420096 Fix the handling of internal Twig_Template properties in the C ext 2015-08-12 17:44:05 +02:00
Christophe Coevoet a8a125ba9b Forbid access to the Twig environment from template instance
This also forbids access to other internal parts of the Twig_Template.
2015-08-12 17:44:05 +02:00
Fabien Potencier 30be07759a fixed sandbox security issue 2015-08-12 17:44:05 +02:00
Christophe Coevoet 7b6c0e971f Prevent importing or calling reserved macro names
This also fixes the logic detecting reserved macro names to account for
the fact that they are compiled prefixed with get() since a very long
time and the logic preventing conflicts was broken.
2015-08-12 17:44:05 +02:00
Fabien Potencier cfb0593028 feature #1757 deprecated Twig_Template::getEnvironment() (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

deprecated Twig_Template::getEnvironment()

Commits
-------

c9501b8 deprecated Twig_Template::getEnvironment()
2015-08-12 16:50:28 +02:00
Fabien Potencier c9501b80a1 deprecated Twig_Template::getEnvironment() 2015-08-12 16:49:10 +02:00
Fabien Potencier 1eb5fb26ef feature #1754 deprecated _self (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

deprecated _self

It never makes sense to use the `_self` variable in a template except for the special `from` and `import` usage. So, I propose to deprecate it in 2.x and remove the unexcepted possible usages in 3.0.

Commits
-------

5514c8e deprecated _self
2015-08-12 11:10:10 +02:00
Fabien Potencier 5514c8ee80 deprecated _self 2015-08-12 11:08:46 +02:00
Fabien Potencier 61d45b3e24 feature #1753 added a base node visitor to make compat between 1.x and 2.x possible (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

added a base node visitor to make compat between 1.x and 2.x possible

As suggested in #1644, that allows better compat between 1.x and 2.x

Commits
-------

881fb63 added a base node visitor to make compat between 1.x and 2.x possible
3f521d4 bumped to 1.20
2015-08-11 15:57:52 +02:00
Fabien Potencier 881fb63bf7 added a base node visitor to make compat between 1.x and 2.x possible 2015-08-11 15:38:01 +02:00
Fabien Potencier 3f521d483f bumped to 1.20 2015-08-11 15:22:12 +02:00
Fabien Potencier e375c9c562 added a mention of projects using Twig 2015-08-04 16:19:10 +02:00
Fabien Potencier 617eaa0009 bumped version to 1.19.1-DEV 2015-07-31 15:50:08 +02:00
Fabien Potencier edbeaf43b0 prepared the 1.19.0 release v1.19.0 2015-07-31 15:45:26 +02:00