Commit Graph

1503 Commits

Author SHA1 Message Date
chalasr d455b52e6b Clarify exception message in Twig_Template::getAttribute
Add missing parenthesis

Adapt twig.c extension

Update the C extension

Use php_ucfirst instead of ucfirst

Try to implement a TWIG_UCFIRST in C extension

Last try ucfirst

Rollback twig.c extension

Remove useless ucfirst + update twig.c extension

Fix mis-escaped char

Repeat argument item for sprintf (first try doesnt work)

Remove unexpected breakline in code
2016-03-31 13:09:57 +02:00
Fabien Potencier 212730aa48 marked some Twig_Environment methods as being internal 2016-01-27 06:24:02 +01:00
Fabien Potencier 317f22132d bumped version to 1.24.1-DEV 2016-01-25 22:25:12 +01:00
Fabien Potencier 3e5aa30ebf prepared the 1.24.0 release 2016-01-25 22:22:18 +01:00
Fabien Potencier 25acc19e22 bumped version to 1.24 2016-01-25 22:21:03 +01:00
Fabien Potencier cdd57f33b5 adding support for the ?? operator 2016-01-25 17:15:20 +01:00
Fabien Potencier 62e8ee3124 fixed the defined test when used on a constant, a map, or a sequence 2016-01-25 16:58:02 +01:00
Fabien Potencier 7dc9fb27a1 minor #1966 Use strict comparison for charset (JhonnyL)
This PR was merged into the 1.x branch.

Discussion
----------

Use strict comparison for charset

There is no reason not to use strict comparison here. Also some minor cs fixes.

Commits
-------

4f32737 compare charset strictly
2016-01-25 15:55:24 +01:00
Fabien Potencier 9cad008311 feature #1964 undeprecated _self (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

undeprecated _self

Un-deprecated `_self`. As mentioned in #1932, `_self` is sometimes used to get the current template name, which is a legitimate usage and almost always the user intent. Moreover, when `_self` is used in a template, it is mostly passed to Twig functions that are able to deal with Twig templates or Twig template names indifferently.

fixes #1932

Commits
-------

b490e65 undeprecated _self
2016-01-19 13:27:34 +01:00
JhonnyL 4f327372bd compare charset strictly 2016-01-17 20:03:22 +01:00
Fabien Potencier b490e6594f undeprecated _self 2016-01-16 06:36:39 +01:00
Fabien Potencier 24d9266d0f bug #1930 Fix Parser context push on stack (molaux)
This PR was squashed before being merged into the 1.x branch (closes #1930).

Discussion
----------

Fix Parser context push on stack

Hello,

With php7RC8, in Twig_Parser, parse method starts by saving current context in
copying self properties on stack. It sounds like get_object_vars returns now
references instead of copies of properties (at least for arrays). Consequently,
when reinitializing Parser for subparse line 92 to 99, the preserved context on
stack was also erased.

As a result, when calling {{ parent() }} after a {%embed%}{%endembed%}, the restored blockStack being empty, Twig throws a Twig_Error_Syntax('Calling "parent" outside a block is forbidden.'), despite the fact it is really in a block that extends another.
When calling {{ parent() }} before  the embed tag, all works properly. (It seems that the empty context, resulting of subparses, is not a problem as far as you don't need to access it)

Commits
-------

07ebdfe Fix Parser context push on stack
2016-01-11 15:50:45 +01:00
Marc-Olivier Laux 07ebdfef4d Fix Parser context push on stack 2016-01-11 15:50:44 +01:00
Fabien Potencier 97d8fec15f bumped version to 1.23.4-DEV 2016-01-11 15:04:36 +01:00
Fabien Potencier ae53fc2c31 prepared the 1.23.3 release 2016-01-11 15:02:19 +01:00
Possum 88ab45b379 Fix typo. 2016-01-11 14:57:20 +01:00
Fabien Potencier d9b3e14ca4 bumped version to 1.23.3-DEV 2016-01-11 14:23:38 +01:00
Fabien Potencier d07c53df79 prepared the 1.23.2 release 2016-01-11 14:20:06 +01:00
Fabien Potencier 8dacaeca7e minor #1954 Improve deprecations message (Ener-Getick)
This PR was merged into the 1.x branch.

Discussion
----------

Improve deprecations message

This PR specifies the version in which some ``Twig_SimpleTest`` were deprecated to make it easier to upgrade a package.

Commits
-------

fdb1937 Improve deprecations message Add the version in the message
2016-01-11 13:24:54 +01:00
Ener-Getick fdb19375f5 Improve deprecations message
Add the version in the message
2016-01-07 18:53:18 +01:00
Possum c3ec2fb1de Make file cache tolerant for trailing (back)slashes on directory configuration. 2016-01-06 10:29:32 +01:00
Martin Hasoň f19318d0e7 Removed usage of deprecated constant 2015-12-14 09:19:50 +01:00
Jez Emery de15975cb3 Fixing a slight typo in interface 2015-11-17 10:34:18 +00:00
Fabien Potencier 9d5e746026 made a small refactoring 2015-11-12 07:56:39 +01:00
Fabien Potencier 093bf70d6c fixed typo 2015-11-11 16:18:23 +01:00
Fabien Potencier b7c124bae0 deprecated a class that has never been used 2015-11-08 10:55:30 +01:00
Fabien Potencier bf326dbb75 bumped version to 1.23.2-DEV 2015-11-05 13:52:08 +01:00
Fabien Potencier d9b6333ae8 prepared the 1.23.1 release 2015-11-05 13:49:06 +01:00
Possum aa7c53ae0a Add dot to the end of exception messages. 2015-11-05 13:20:01 +01:00
Possum 8bb9b83e32 CS 2015-11-05 10:12:15 +01:00
Possum 355213ba6c static vs. self 2015-11-05 10:11:09 +01:00
Possum d4e3adaaee Code grooming 2015-11-05 10:04:30 +01:00
Richard van Laak cb5ea5244f fix deprecation message typo 2015-11-03 17:56:06 +01:00
Fabien Potencier e7e334c8b2 bug #1907 made exception messages more precise (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

made exception messages more precise

Replaces #1906 and #1902

Commits
-------

04d6738 fixed typos
2015-11-02 19:00:50 +01:00
Fabien Potencier 79af12a1d2 bug #1905 fix BC, revert to pre 1.23 behavior, and make use of pattern an option (remicollet)
This PR was merged into the 1.x branch.

Discussion
----------

fix BC, revert to pre 1.23 behavior, and make use of pattern an option

For context see twigphp/Twig-extensions#155

Commits
-------

ee5e25e fix BC, revert to pre 1.23 behavior, and make use of pattern an option
2015-11-02 15:52:06 +01:00
Fabien Potencier 04d6738ddf fixed typos 2015-11-02 15:47:58 +01:00
Remi Collet ee5e25eb46 fix BC, revert to pre 1.23 behavior, and make use of pattern an option 2015-11-02 15:13:46 +01:00
Christian Raue 2660286d28 fixed Twig_Extension_GlobalsInterface name in comments 2015-11-02 13:15:25 +01:00
Fabien Potencier b9b6f367e1 bumped version to 1.23.1-DEV 2015-10-29 16:33:13 -07:00
Fabien Potencier 5868cd822f prepared the 1.23.0 release 2015-10-29 16:29:01 -07:00
Fabien Potencier d83deb9f32 feature #1897 deprecated Twig_ExtensionInterface::getGlobals() (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

deprecated Twig_ExtensionInterface::getGlobals()

Commits
-------

e3a325f deprecated Twig_ExtensionInterface::getGlobals()
2015-10-29 16:18:41 -07:00
Fabien Potencier e3a325f249 deprecated Twig_ExtensionInterface::getGlobals() 2015-10-29 16:13:49 -07:00
Fabien Potencier 7220fd2d88 fixed typo 2015-10-27 22:39:34 -07:00
Fabien Potencier 72485c2ea0 deprecated the possibility to override an extension by registering another one with the same name 2015-10-27 22:04:22 -07:00
Fabien Potencier 847d48e790 feature #1886 deprecated Twig_ExtensionInterface::initRuntime() (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

deprecated Twig_ExtensionInterface::initRuntime()

I'm working on splitting Twig extensions into 2 different phases: compilation and runtime. The goal is to avoid having to load the runtime environment of an extension when compiling templates. That also opens the way to be able to lazy-load Twig extensions.

While working on the split, I realized that the `initRuntime()` method on `Twig_ExtensionInterface` is not needed anymore. It was added at a time `needs_environment` did not exist and was a way to keep the environment around for custom filters/tests/functions. But nowadays, that's not needed anymore. I did a quick search on Github, and most of the implementation I found just store the environment in a local property, which is not needed anymore. So, I propose to deprecate it in 1.x and remove it in 2.0.

Commits
-------

9774f4f deprecated Twig_ExtensionInterface::initRuntime()
2015-10-27 20:46:45 -07:00
Fabien Potencier d4f699a089 minor #1894 removed useless phpdocs (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

removed useless phpdocs

Commits
-------

6450c87 removed useless phpdocs
2015-10-27 20:44:19 -07:00
Fabien Potencier dbd7884857 minor #1893 fixed message inconsistency (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

fixed message inconsistency

Commits
-------

12ea202 fixed message inconsistency
2015-10-27 20:40:16 -07:00
Fabien Potencier 12ea20245c fixed message inconsistency 2015-10-26 19:17:27 +01:00
Fabien Potencier 6450c870ae removed useless phpdocs 2015-10-26 18:35:50 +01:00
Fabien Potencier 9caf7722cc renamed a method 2015-10-26 15:00:58 +01:00