Commit Graph

3263 Commits

Author SHA1 Message Date
Fabien Potencier 8bc1c950cd added missing entries in CHANGELOG 2017-06-05 10:23:40 -07:00
Fabien Potencier 1cb696c6ea bumped version to 1.34.1-DEV 2017-06-05 10:17:28 -07:00
Fabien Potencier b38636760c prepared the 1.34.0 release v1.34.0 2017-06-05 10:16:52 -07:00
Fabien Potencier 3c132d066a minor #2496 [Doc] Fixed documentation about 'Definition vs Runtime' (lyrixx)
This PR was merged into the 1.x branch.

Discussion
----------

[Doc] Fixed documentation about 'Definition vs Runtime'

Commits
-------

c0b5eb9f [Doc] Fixed documentation about 'Definition vs Runtime'
2017-06-02 07:37:47 -07:00
Grégoire Pineau c0b5eb9f03 [Doc] Fixed documentation about 'Definition vs Runtime' 2017-06-02 16:26:53 +02:00
Fabien Potencier f6e0000499 minor #2494 Fix Twig\Environment alias (nicolas-grekas)
This PR was merged into the 1.x branch.

Discussion
----------

Fix Twig\Environment alias

Commits
-------

8e03fa3e Fix Twig\Environment alias
2017-06-01 06:51:30 -07:00
Nicolas Grekas 8e03fa3e1c Fix Twig\Environment alias 2017-06-01 06:42:27 +02:00
Fabien Potencier 04ef7a11b7 reverted renaming of Twig\Environment to Twig\Twig 2017-05-31 13:18:51 -07:00
Fabien Potencier aad17a1a35 bug #2490 [1.x] Allow using namespaced aliases as extension names (nicolas-grekas)
This PR was merged into the 1.x branch.

Discussion
----------

[1.x] Allow using namespaced aliases as extension names

Commits
-------

c9a2f3db [1.x] Allow using namespaced aliases as extension names
2017-05-31 10:34:55 -07:00
Nicolas Grekas c9a2f3db8b [1.x] Allow using namespaced aliases as extension names 2017-05-31 14:35:57 +02:00
Fabien Potencier 460712d35e feature #2484 Add namespaced aliases (nicolas-grekas)
This PR was squashed before being merged into the 1.x branch (closes #2484).

Discussion
----------

Add namespaced aliases

Commits
-------

5420a5e3 Add the aliases
71af32b3 Add namespaced aliases
2017-05-25 15:35:04 -07:00
Nicolas Grekas 5420a5e3f8 Add the aliases 2017-05-25 08:32:07 +02:00
Nicolas Grekas 71af32b306 Add namespaced aliases 2017-05-24 10:12:32 +02:00
Fabien Potencier eb58c61536 reworded docs 2017-05-22 07:52:05 +02:00
Fabien Potencier 4e019d4854 minor #2473 Update number_format.rst (DarkBee)
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes #2473).

Discussion
----------

Update number_format.rst

Added warning when trying to format negative numbers at literal

Commits
-------

40fdb9e3 Update number_format.rst
2017-05-22 07:50:40 +02:00
DarkBee 40fdb9e3e5 Update number_format.rst 2017-05-22 07:50:40 +02:00
Fabien Potencier c6bd2df147 feature #2478 Drop support for HHVM (fabpot)
This PR was squashed before being merged into the 1.x branch (closes #2478).

Discussion
----------

Drop support for HHVM

Commits
-------

b6a4895e fixed tests for PHP 7.2
6ff8d6f4 dropped support for HHVM
2017-05-22 07:48:34 +02:00
Fabien Potencier b6a4895ea8 fixed tests for PHP 7.2 2017-05-22 07:43:40 +02:00
Fabien Potencier 6ff8d6f4e2 dropped support for HHVM 2017-05-22 07:24:53 +02:00
Fabien Potencier 860f80178b minor #2469 Length filter non-mb_string on 7.x fix. (SpacePossum)
This PR was merged into the 1.x branch.

Discussion
----------

Length filter non-mb_string on 7.x fix.

follow up on https://github.com/twigphp/Twig/pull/2462
after https://github.com/twigphp/Twig/issues/2464#issuecomment-301014241

Commits
-------

3aa2e884 Length filter non-mb_string on 7.x fix.
2017-05-12 06:54:14 -07:00
Fabien Potencier 97d741ab60 minor #2467 added PHP 7.2 to the test matrix (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

added PHP 7.2 to the test matrix

Commits
-------

0768f10b added PHP 7.2 to the test matrix
2017-05-12 06:52:17 -07:00
Fabien Potencier ad599308e0 feature #2468 Fix code for older versions of PHP (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Fix code for older versions of PHP

Commits
-------

75f2231a fixed code for older versions of PHP
2017-05-12 06:50:32 -07:00
SpacePossum 3aa2e884ae Length filter non-mb_string on 7.x fix. 2017-05-12 10:40:10 +02:00
Fabien Potencier 75f2231a45 fixed code for older versions of PHP 2017-05-11 15:26:49 -07:00
Fabien Potencier d884330572 bumped version to 1.34 2017-05-11 14:48:03 -07:00
Fabien Potencier ccee78ec6c feature #2452 Support PHPUnit 6 for testing extensions (hkdobrev)
This PR was merged into the 1.x branch.

Discussion
----------

Support PHPUnit 6 for testing extensions

When testing a Twig extension via the provided test cases [according to the documentation](https://twig.sensiolabs.org/doc/2.x/advanced.html#testing-an-extension), PHPUnit 6 is not supported.

I think we should force people who haven't upgraded to upgrade to PHPUnit 6 instead of limiting the ones who did.

Also, Twig 2.x runs only on PHP 7. People using Twig 2.x would most likely also test their code on PHP 7. Even though PHPUnit 5 supports PHP 7, I think most people who have updated PHP could update or would have already updated PHPUnit.

Commits
-------

8ebaf8e6 Support PHPUnit 6 for testing extensions
2017-05-11 14:46:15 -07:00
Haralan Dobrev 8ebaf8e644 Support PHPUnit 6 for testing extensions 2017-05-12 00:29:48 +03:00
Fabien Potencier 0768f10b9d added PHP 7.2 to the test matrix 2017-05-11 13:34:27 -07:00
Fabien Potencier f4adaef9f1 fixed tests 2017-05-11 13:24:58 -07:00
Fabien Potencier 537db199c2 bug #2462 Prepare for php 7.2 (hboomsma)
This PR was merged into the 1.x branch.

Discussion
----------

Prepare for php 7.2

* allow `|length` of `null`
* allow `|length` of objects not implementing `\Countable`

*To get no errors when running with PHP 7.2 You need to use phpunit
^6.1, otherwise the `each` function, used by phpunit, triggers errors.
You can do so by running phpunit like:
`SYMFONY_PHPUNIT_VERSION=6.1 phpnightly vendor/bin/simple-phpunit`*

Commits
-------

d2b7a01a Prepare for php 7.2
2017-05-11 13:23:40 -07:00
Fabien Potencier cf93147901 bug #2465 Fix generating template name in createTemplate() method (pulzarraider)
This PR was merged into the 1.x branch.

Discussion
----------

Fix generating template name in createTemplate() method

Before this change the name for the template was generated randomly based on uniqid(mt_rand()). It generated new file whenever the template was loaded as string using the `template_from_string` function even the template was the same. The generated file wasn't used anymore.

Now the cache file is generated by the content of template so using the `template_from_string` is much faster and doesn't pollute the cache folder with unneeded files.

Commits
-------

a7c8b082 Fix generating template name in createTemplate() method
2017-05-11 07:50:20 -07:00
Andrej Hudec a7c8b08270 Fix generating template name in createTemplate() method
Before this change the name for the template was generated randomly based on uniqid(mt_rand()). It generated new file whenever the  template was loaded as string using the `template_from_string`  even the template was the same. The generated file wasn't used anymore.
Now the cache file is generated by the content of template so using the `template_from_string` is faster and doesn't pollute the cache folder with unneeded files.
2017-05-11 12:36:01 +02:00
Hidde Boomsma d2b7a01a18 Prepare for php 7.2
* allow `|length` of `null`
* allow `|length` of objects not implementing `\Countable`

* To get no errors when running with PHP 7.2 You need to use phpunit
^6.1, otherwise the `each` function, used by phpunit, triggers errors.
You can do so by running phpunit like:
`SYMFONY_PHPUNIT_VERSION=6.1 phpnightly vendor/bin/simple-phpunit` *
2017-05-08 09:03:00 +02:00
Fabien Potencier 324ab87d2f minor #2461 Fix typo in advanced.rst file (fre5h)
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes #2461).

Discussion
----------

Fix typo in `advanced.rst` file

Commits
-------

a264fc62 Fix typo in `advanced.rst` file
2017-05-05 06:59:56 -07:00
Artem Genvald a264fc62e5 Fix typo in advanced.rst file 2017-05-05 06:59:56 -07:00
Fabien Potencier a083db55c2 removed a @final tag 2017-04-26 14:47:34 -04:00
Fabien Potencier ef680be80e bumped version to 1.33.3-DEV 2017-04-20 11:41:13 -06:00
Fabien Potencier dd6ca96227 prepared the 1.33.2 release v1.33.2 2017-04-20 11:39:48 -06:00
Fabien Potencier 0db54be684 bug #2449 fixed edge case in the method cache for Twig attributes (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

fixed edge case in the method cache for Twig attributes

closes #2447

Commits
-------

413be416 fixed edge case in the method cache for Twig attributes
2017-04-20 11:37:13 -06:00
Fabien Potencier 413be4167b fixed edge case in the method cache for Twig attributes 2017-04-18 16:52:31 -06:00
Fabien Potencier 530be06a5a bumped version to 1.33.2-DEV 2017-04-18 15:44:30 -06:00
Fabien Potencier a87f959f4b prepared the 1.33.1 release v1.33.1 2017-04-18 15:43:11 -06:00
Fabien Potencier 9b417f4212 updated CHANGELOG 2017-04-18 15:38:12 -06:00
Fabien Potencier dab65824ec minor #2448 Wrong stdClass class name generates warning (chrisCheeseBurgames)
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes #2448).

Discussion
----------

Wrong stdClass class name generates warning

Commits
-------

38987c93 Wrong stdClass class name generates warning
2017-04-18 07:54:16 -06:00
Christophe SAUVEUR 38987c9349 Wrong stdClass class name generates warning 2017-04-18 07:53:53 -06:00
Fabien Potencier dc70f3e826 added more is_object() safegaruds 2017-04-05 16:23:01 -07:00
Fabien Potencier 4a722dd02f bug #2433 Fix #2431 (mpdude)
This PR was merged into the 1.x branch.

Discussion
----------

Fix #2431

See title

Commits
-------

a5c2da6d test if is_object before calling method_exists, fixes #2431
2017-04-05 16:21:29 -07:00
Fabien Potencier cede5f3fbf minor #2434 Autoescape test addition; collision fix in Array Loader. (dave-newson)
This PR was squashed before being merged into the 1.x branch (closes #2434).

Discussion
----------

Autoescape test addition; collision fix in Array Loader.

This PR makes two changes. It was created while testing a third issue that was discovered to be fixed in the latest version.

## Added JS to Autoescape: name test

This adds "index.js.html" to the autoescape:name test, proving the functionality of the JS escape system and the name guessing strategy.

## Fixed collision in Array Loader

While trying to run the above test, it was discovered that the Array Loader uses the content of the template file as the "key" for determining which compiled template to load.
As the above test uses identical content for both HTML and JS templates this led to the compiled HTML template always being loaded.

This change prepends the content with the filename, which vaguely follows the same mechanism as the "options" (which are appended after `getCacheKey` is called).

**This change might be a backwards-incompatible change** depending on your interpretation of how `Loader/Array` is intended to be used.
The class itself states:
> This loader should only be used for unit testing.

The assumption is it's OK for this to occur.

Test cases have been updated to take this key change into account, and an additional test has been added to confirm `Loader/Array` specifically has the capability to resolve two files with the same content to different keys.

Commits
-------

da82b41a Autoescape test addition; collision fix in Array Loader.
2017-04-05 16:19:31 -07:00
dave-newson da82b41ac2 Autoescape test addition; collision fix in Array Loader. 2017-04-05 16:19:30 -07:00
Matthias Pigulla a5c2da6de0 test if is_object before calling method_exists, fixes #2431 2017-03-24 15:59:34 +01:00