Commit Graph

2168 Commits

Author SHA1 Message Date
Fabien Potencier 107fd201bf feature #1286 Adding ignoreStrictCheck option for call_user_func_array, if throwing exception (fabpot)
This PR was merged into the master branch.

Discussion
----------

Adding ignoreStrictCheck option for call_user_func_array, if throwing exception

Same as #1236 with added unit tests and C extension support (to come).

"I experienced the issue when using FuelPHP's ORM with EAV containers. When I tried to reference a property that was not defined I expected to get null, but instead the whole application stopped because an exception was thrown in the ORM, that no such function is present.

I couldn't find other possible exception that could be thrown when this function is called, so I assumed it's safe to take the ignoreStrictCheck into consideration here."

Commits
-------

1abf5d9 [ext] Mirroring PHP change for call_user_func_array, see #1286
9ab290b added tests for exceptions thrown in __call()
c711d37 Adding ignoreStrictCheck option for call_user_func_array, if throwing exception
2013-12-03 15:08:30 +01:00
Tugdual Saunier 1abf5d99fa [ext] Mirroring PHP change for call_user_func_array, see #1286 2013-12-03 15:03:12 +01:00
Fabien Potencier 9ab290bdb2 added tests for exceptions thrown in __call() 2013-12-03 14:14:58 +01:00
Fabien Potencier 7e7818e48f feature #1277 Added min and max function (lyrixx)
This PR was merged into the master branch.

Discussion
----------

Added min and max function

usefull for pagination

Commits
-------

6aa06de Added min and max function
2013-12-03 14:05:12 +01:00
Barta Tamás c711d37f1d Adding ignoreStrictCheck option for call_user_func_array, if throwing exception 2013-12-03 13:58:06 +01:00
Grégoire Pineau 6aa06dea05 Added min and max function 2013-12-03 13:46:57 +01:00
Fabien Potencier c9eca3508c fixed typo 2013-12-03 13:41:51 +01:00
Fabien Potencier 1747c337cb minor #1285 Corrected description of the "//" operator (ureimers)
This PR was merged into the master branch.

Discussion
----------

Corrected description of the "//" operator

The operator was previously described to truncate the the value when it in fact floors the result of the division (which can be seen in https://github.com/fabpot/Twig/blob/master/lib/Twig/Node/Expression/Binary/FloorDiv.php#L20).
By the old description one would think that ``{{ -20 // 7 }}`` would yield -2 (as in ``(int)(-20/7)``) when it actually returns -3 (as in ``floor(-20/7)``). Floor is not truncate (cast to int).

Commits
-------

a360bc0 Corrected description of the "//" operator
2013-12-03 13:41:40 +01:00
Fabien Potencier 697568bca2 fixed phpdoc 2013-12-03 13:38:38 +01:00
Fabien Potencier 05273c1502 feature #1261 added TokenStream::nextIf() (fabpot)
This PR was merged into the master branch.

Discussion
----------

added TokenStream::nextIf()

The introduction of `nextIf()` simplified a lot of code.

Commits
-------

0ed7898 added TokenStream::nextIf()
2013-12-03 13:29:21 +01:00
Fabien Potencier 0ed7898089 added TokenStream::nextIf() 2013-12-03 13:28:58 +01:00
ureimers a360bc037c Corrected description of the "//" operator
The operator was previously described to truncate the the value when it in fact floors the result of the division (which can be seen in https://github.com/fabpot/Twig/blob/master/lib/Twig/Node/Expression/Binary/FloorDiv.php#L20).
By the old description one would think that ``{{ -20 // 7 }}`` would yield -2 (as in ``(int)(-20/7)``) when it actually returns -3 (as in ``floor(-20/7)``). Floor is not truncate (cast to int).
2013-12-03 12:55:12 +01:00
Fabien Potencier cab9fd9a10 minor #1280 [Docs] Fix typos (bicpi)
This PR was merged into the master branch.

Discussion
----------

[Docs] Fix typos

Commits
-------

6ea9d8f [Docs] Fix typos
2013-11-24 19:36:20 +01:00
Philipp Rieber 6ea9d8f17d [Docs] Fix typos 2013-11-24 06:39:33 +01:00
Fabien Potencier f7c00d336f feature #1255 added the round filter (fabpot)
This PR was merged into the master branch.

Discussion
----------

added the round filter

fixes #1238

Commits
-------

ff4a7d2 added the round filter
2013-11-23 22:24:07 +01:00
Fabien Potencier 65880a7877 minor #1279 [Docs] Some minor fixes: Typos, Notations, Formatting (bicpi)
This PR was merged into the master branch.

Discussion
----------

[Docs] Some minor fixes: Typos, Notations, Formatting

Fixes for:
* Notations: html > HTML; javascript > JavaScript; composer > Composer
* Typos
* Wrong function names: ``escaper`` > ``escape``; ``include`` > ``source`` (in new chapter about ``source``)
* Formatting issues, e.g. remove RST from code blocks, it's not evaluated
* Wording where code sample outputs something: returns > outputs
* ``true`` parameter for ``autoescape`` - not needed any more

Commits
-------

a21df95 [Docs] Some minor fixes: Typos, Notations
2013-11-23 22:23:01 +01:00
Philipp Rieber a21df952ab [Docs] Some minor fixes: Typos, Notations 2013-11-23 21:51:26 +01:00
Fabien Potencier 39eb50c00e fixed optimizer max value 2013-11-14 09:08:49 +01:00
Fabien Potencier 2d012c4a4a minor #1270 Use string instead of large integer (ptarjan)
This PR was merged into the master branch.

Discussion
----------

Use string instead of large integer

HHVM differs from php-src on large integer parsing (php-src converts
them to floats, HHVM truncates them but leaves them as integers). The
point of this test is to make sure Twig parses it correctly, not the
underlying PHP execution engine.

Commits
-------

d401717 Use string instead of large integer
2013-11-13 09:11:09 +01:00
ptarjan d40171701f Use string instead of large integer
HHVM differs from php-src on large integer parsing (php-src converts
them to floats, HHVM truncates them but leaves them as integers). The
point of this test is to make sure Twig parses it correctly, not the
underlying PHP execution engine.
2013-11-12 23:38:46 -08:00
Fabien Potencier 8f7bea047e minor #1269 various cleanups (cordoval)
This PR was squashed before being merged into the master branch (closes #1269).

Discussion
----------

various cleanups

fix bool -> Boolean for consistency in other parts of twig's code removing
assignment to n as it is never used fix typo and docblock for consistency
remove line break not needed for consistency fix array docblock for
consistency

Commits
-------

cb651e8 various cleanups
2013-11-12 18:59:00 +01:00
Luis Cordova cb651e8ebb various cleanups 2013-11-12 18:58:59 +01:00
Fabien Potencier ff4a7d29ac added the round filter 2013-11-12 08:49:56 +01:00
Fabien Potencier 10da58c83b moved README to rst 2013-11-11 20:04:42 +01:00
Fabien Potencier cf21274a00 minor #1260 fix typo 'in' operator (thewholelifetolearn)
This PR was merged into the master branch.

Discussion
----------

fix typo 'in' operator

Fixed a small typo in the negative 'in' test operator

Commits
-------

f9013d5 fix typo 'in' operator
2013-11-06 11:15:23 +01:00
Ralph KEMPS f9013d5546 fix typo 'in' operator
Fixed a small typo in the negative 'in' test operator
2013-11-06 10:39:15 +01:00
Fabien Potencier 3a6ffbb0f0 minor #1259 Fixed ZendServer specific DLL Path in install doc (tucksaun)
This PR was merged into the master branch.

Discussion
----------

Fixed ZendServer specific DLL Path in install doc

It seems the \ need to be escaped in the tip section.

(see the file on github or the Twig website)

Commits
-------

2b102e3 Fixed ZendServer specific DLL Path in install doc
2013-11-03 20:14:49 +01:00
Tugdual Saunier 2b102e366b Fixed ZendServer specific DLL Path in install doc
It seems the \ need to be escaped in the tip section.

(see the file on github or the Twig website)
2013-11-03 20:10:18 +01:00
Fabien Potencier 0906728a74 updated CHANGELOG 2013-11-03 10:12:32 +01:00
Fabien Potencier bdb5f8f02e bug #1258 Fix twig_first and twig_last filters for UTF8 multibyte strings (chEbba)
This PR was squashed before being merged into the master branch (closes #1258).

Discussion
----------

Fix twig_first and twig_last filters for UTF8 multibyte strings

After string is sliced we already have the right result with a first/last letter for UTF8 string.

Commits
-------

6003ae4 Fix twig_first and twig_last filters for UTF8 multibyte strings
2013-11-03 10:11:57 +01:00
Kirill chEbba Chebunin 6003ae43b9 Fix twig_first and twig_last filters for UTF8 multibyte strings 2013-11-03 10:11:57 +01:00
Fabien Potencier 6aea4d97b6 feature #1257 added a source function to include the content of a template without rendering it (fabpot)
This PR was merged into the master branch.

Discussion
----------

added a source function to include the content of a template without rendering it

Replaces #1230.

There is one question about the implementation: Should the content be considered safe (which is the current implementation)?

Commits
-------

dff7d2c added a source function to include the content of a template without rendering it
2013-11-02 21:45:37 +01:00
Fabien Potencier dff7d2c758 added a source function to include the content of a template without rendering it 2013-10-31 13:38:11 +01:00
Fabien Potencier 726a40a1b4 bumped version to 1.15 2013-10-31 13:37:55 +01:00
Fabien Potencier bc32ed81d5 Revert "merged branch Cottser/master (PR #1071)"
This reverts commit 2f5c9899a4, reversing
changes made to 4e7094f6a3.

Conflicts:
	lib/Twig/Environment.php
2013-10-31 13:17:35 +01:00
Fabien Potencier 43b8338e04 bug #1256 Fixed C extension sandbox behavior (tucksaun)
This PR was squashed before being merged into the master branch (closes #1256).

Discussion
----------

Fixed C extension sandbox behavior

fixes #1254

Commits
-------

40bba0e Fixed C extension sandbox behavior
2013-10-31 12:37:11 +01:00
Tugdual Saunier 40bba0e447 Fixed C extension sandbox behavior 2013-10-31 12:37:11 +01:00
Fabien Potencier 8fcde6a091 bumped version to 1.14.3-DEV 2013-10-30 09:31:01 +01:00
Fabien Potencier ca445842fc prepared the 1.14.2 release v1.14.2 2013-10-30 09:20:53 +01:00
Fabien Potencier 5d31b14cbf added missing @throws 2013-10-28 14:44:04 +01:00
Fabien Potencier 72f9bd8ab4 bug #1249 fixed error filename/line when an error occurs in an included file (fabpot)
This PR was merged into the master branch.

Discussion
----------

fixed error filename/line when an error occurs in an included file

fixed #1141

Commits
-------

ba0bf63 refactored some tests
1cdc913 fixed error filename/line when an error occurs in an included file
de985a8 failing test
2013-10-28 14:36:23 +01:00
Fabien Potencier 0294a1395b feature #1208 allowed tests to be made of 1 or 2 words (fabpot)
This PR was merged into the master branch.

Discussion
----------

allowed tests to be made of 1 or 2 words

Commits
-------

52c952c allowed tests to be made of 1 or 2 words
2013-10-28 11:44:48 +01:00
Fabien Potencier 5444c29065 bug #1248 allowed operators that contain whitespaces to have more than one whitespace (fabpot)
This PR was merged into the master branch.

Discussion
----------

allowed operators that contain whitespaces to have more than one whitespace

Commits
-------

724dc61 allowed operators that contain whitespaces to have more than one whitespace
2013-10-28 11:43:01 +01:00
Fabien Potencier ba0bf636a8 refactored some tests 2013-10-27 19:42:36 +01:00
Fabien Potencier 1cdc913f4c fixed error filename/line when an error occurs in an included file
To be able to cover all cases, we need to catch the exception when we
know the execution context (the block being rendered). The only
possibility is to actually try/catch exceptions in the displayBlock()
method directly.
2013-10-27 19:42:31 +01:00
Kris Wallsmith de985a872f failing test
the error filename is incorrect when an exception is thrown from an
included file
2013-10-27 19:35:55 +01:00
Fabien Potencier 52c952c1a6 allowed tests to be made of 1 or 2 words 2013-10-27 19:31:19 +01:00
Fabien Potencier 724dc61bea allowed operators that contain whitespaces to have more than one whitespace 2013-10-27 10:57:04 +01:00
Fabien Potencier 5eb8373b1c removed whitespaces 2013-10-26 09:59:29 +02:00
Fabien Potencier 932f7fcb75 removed whitespaces in docs 2013-10-26 08:34:09 +02:00