Commit Graph

658 Commits

Author SHA1 Message Date
Possum a80cb35e51 Fix time sensitive profiler test (ready) 2015-02-16 11:15:49 +01:00
Fabien Potencier 5a5a640cbc minor #1609 get PHP version info once on construction (SpacePossum)
This PR was squashed before being merged into the 1.18-dev branch (closes #1609).

Discussion
----------

get PHP version info once on construction

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes

Hi,
I was profiling a project and noticed that `phpversion` was called 5000 times by Twig.
This patch reduces the amount of calls without breaking anything (I hope ;)  )

![twig_phpversion](https://cloud.githubusercontent.com/assets/10462973/5921451/53d3e66c-a644-11e4-94aa-a3daf762e34d.png)

Commits
-------

24ff698 get PHP version info once on construction
2015-01-29 10:43:27 +01:00
Possum 24ff698dc5 get PHP version info once on construction 2015-01-29 10:43:24 +01:00
Kris Wallsmith 7868fe838e fixed named args for static methods 2015-01-29 16:46:20 +13:00
Fabien Potencier e7c5bde274 added some more unit tests 2015-01-25 17:01:33 +01:00
Fabien Potencier d34628dd36 bug #1585 Fixed wrong line numbers in error messages for multi-line statements (hason)
This PR was merged into the 1.18-dev branch.

Discussion
----------

Fixed wrong line numbers in error messages for multi-line statements

Partially fixes #1351

Commits
-------

08c5196 Fixed wrong line numbers in error messages for multi-line statements
2015-01-25 16:37:05 +01:00
Martin Hasoň e9b8bccec3 Fixed determining the necessary arguments for callable functions 2015-01-22 14:23:03 +01:00
Martin Hasoň 5f4377b863 Improved an exception message for missing value of optional arguments 2015-01-22 14:22:52 +01:00
Martin Hasoň 08c51964e2 Fixed wrong line numbers in error messages for multi-line statements 2015-01-21 10:46:46 +01:00
Fabien Potencier 3b12d558bb removed the special Sandbox Module class 2015-01-20 19:30:00 +01:00
Fabien Potencier 89df3c20ef fixed CS 2015-01-20 14:45:25 +01:00
Fabien Potencier 4408caae0c added a profiler 2015-01-20 03:04:00 +01:00
Fabien Potencier f5972259d2 bug #1598 FIX #1596 FileSystem::findTemplate now applies realpath on the absolute ... (xavierleune)
This PR was squashed before being merged into the 1.17-dev branch (closes #1598).

Discussion
----------

FIX #1596 FileSystem::findTemplate now applies realpath on the absolute ...

...path before returning it.

This is a purposal to fix the issue #1596.
Please make any feedback needed.

Commits
-------

5074114 FIX #1596 FileSystem::findTemplate now applies realpath on the absolute ...
2015-01-20 02:51:40 +01:00
Xavier Leune 5074114bbb FIX #1596 FileSystem::findTemplate now applies realpath on the absolute ... 2015-01-20 02:51:38 +01:00
Fabien Potencier 175a7c31be removed unneeded method 2015-01-19 02:18:13 +01:00
Fabien Potencier 01ab6f317b added some more tests for the filename autoescape strategy 2015-01-14 07:56:45 +01:00
Fabien Potencier 4481bf5f38 added an escaping strategy based on the template filename extension 2015-01-13 16:33:59 +01:00
Martin Hasoň d2fc98d026 Fixed regression for dynamic parent 2014-12-09 23:17:55 +01:00
Albert Casademont 4319bb9b84 Fix the For optimizer, "include" function was always optimized 2014-12-04 16:17:48 +01:00
Fabien Potencier 4ba0789614 removed @covers annotations 2014-11-20 08:47:31 +01:00
Fabien Potencier 73baf337b2 cleaned up tests 2014-10-23 08:17:02 +02:00
Fabien Potencier a88500e762 bug #1551 Fixed using of unary operators with default parameters (hason)
This PR was merged into the 1.16-dev branch.

Discussion
----------

Fixed using of unary operators with default parameters

Fixes #1322

Commits
-------

5ba4e9c Fixed using of unary operators with default parameters
2014-10-23 08:11:36 +02:00
Fabien Potencier 79333cc8e3 feature #1548 Improved an exception message for unknown arguments (hason)
This PR was merged into the 1.16-dev branch.

Discussion
----------

Improved an exception message for unknown arguments

Commits
-------

6427189 Improved an exception message for unknown arguments
2014-10-23 08:07:50 +02:00
Fabien Potencier 72cb567474 bug #1550 Fixed php error for "in" operator (hason)
This PR was merged into the 1.16-dev branch.

Discussion
----------

Fixed php error for "in" operator

I have added the tests and also fixed the php error ``An exception has been thrown during the rendering of a template ("strlen() expects parameter 1 to be string, array given")``.

Commits
-------

8dfeda0 Fixed "in" operator for resources and strings
2014-10-22 16:42:06 +02:00
Fabien Potencier c2a1385389 feature #1529 Fixed guessing a template info for the Twig_Error_Loader exception (hason)
This PR was merged into the 1.16-dev branch.

Discussion
----------

Fixed guessing a template info for the Twig_Error_Loader exception

Commits
-------

8f617dc Fixed guessing a template info for the Twig_Error_Loader exception
2014-10-22 16:34:32 +02:00
Martin Hasoň 8dfeda01c1 Fixed "in" operator for resources and strings 2014-10-22 08:34:49 +02:00
Martin Hasoň 5ba4e9c606 Fixed using of unary operators with default parameters 2014-10-21 09:39:34 +02:00
Roman Lasinski d95d0fd300 Fix for broken BC through #1503: The slice filter works as the array_slice PHP function for arrays 2014-10-21 08:45:27 +02:00
Krystian Kuczek 3aa177118b Moved skip for HHVM
Skip for HHVM was moved up as test is Failed earlier trying to access
DateTime->date.
2014-10-21 00:59:07 +02:00
Martin Hasoň 8f617dc6b5 Fixed guessing a template info for the Twig_Error_Loader exception 2014-10-20 11:57:38 +02:00
Fabien Potencier a7edb17646 Revert "bug #1470 Fixed "in" operator (hason)"
This reverts commit 5b172b5175, reversing
changes made to 0d0cdba3bb.
2014-10-16 20:28:23 +02:00
Martin Hasoň 6427189000 Improved an exception message for unknown arguments 2014-10-16 13:41:31 +02:00
Fabien Potencier 385a83b4e4 Revert "bug #1535 fixed negative number lexing (fabpot)"
This reverts commit 7bda3b6103, reversing
changes made to c86e621e09.

Conflicts:
	CHANGELOG
2014-10-16 10:29:01 +02:00
Fabien Potencier 083313abb4 added some failing tests 2014-10-14 19:06:56 +02:00
Fabien Potencier 7bda3b6103 bug #1535 fixed negative number lexing (fabpot)
This PR was merged into the 1.16-dev branch.

Discussion
----------

fixed negative number lexing

Fixes #1368 and #1322.

I don't see it breaking BC as relying on the current way seems weird to me.

Commits
-------

bf541bf fixed negative number lexing
2014-10-14 18:19:19 +02:00
Fabien Potencier bf541bf249 fixed negative number lexing 2014-10-14 18:08:14 +02:00
Christophe Coevoet 0082e0523c Fixed the support of 2-word tests without a custom node class 2014-10-14 12:50:18 +02:00
Fabien Potencier c476a6b1fc added missing tests 2014-10-12 00:29:52 +02:00
Fabien Potencier b5f074207d fixed macros when using an argument named like a PHP super globa 2014-10-11 22:38:36 +02:00
Fabien Potencier 8a36022dde bug #1533 Make date_modify work with DateTimeImmutable (globin)
This PR was squashed before being merged into the 1.16-dev branch (closes #1533).

Discussion
----------

Make date_modify work with DateTimeImmutable

Use the return value of `$date->modify` because `DateTimeImmutable::modify`
returns the modified object and does not modify the object modify was
called on.

Commits
-------

a5fe46f Make date_modify work with DateTimeImmutable
2014-10-11 22:13:21 +02:00
Robin Gloster a5fe46fce7 Make date_modify work with DateTimeImmutable 2014-10-11 22:13:17 +02:00
Fabien Potencier d3eda6aedd added some more tests 2014-10-11 18:53:37 +02:00
Fabien Potencier 28fc3bb0cd bug #1521 Fix MB characters handling in split (1emming)
This PR was squashed before being merged into the 1.16-dev branch (closes #1521).

Discussion
----------

Fix MB characters handling in split

The PR fixes using multibyte characters in the ```split```-filter

Since I messed up the rebase of https://github.com/fabpot/Twig/pull/1446 I created a new PR.
Let me know if this something that is kind of wanted, thanks!

Commits
-------

8cde52d Fix MB characters handling in split
2014-10-11 01:33:37 +02:00
1emming 8cde52d222 Fix MB characters handling in split 2014-10-11 01:33:34 +02:00
Andrey Grachov f76e67f91d Fixed usage of LimitIterator 2014-10-11 01:28:33 +02:00
Fabien Potencier bad42dbb32 bug #1530 Improved error reporting in a sandboxed template (hason)
This PR was merged into the 1.16-dev branch.

Discussion
----------

Improved error reporting in a sandboxed template

Commits
-------

58efc42 Improved error reporting in a sandboxed template
2014-10-10 15:57:57 +02:00
Fabien Potencier 194f6a14dc bug #1528 Fixed guessing a template info for exceptions (hason)
This PR was merged into the 1.16-dev branch.

Discussion
----------

Fixed guessing a template info for exceptions

Commits
-------

42cd697 Fixed guessing a template info for exceptions
2014-10-10 15:46:25 +02:00
Martin Hasoň 58efc421dc Improved error reporting in a sandboxed template 2014-10-10 15:36:50 +02:00
Martin Hasoň 42cd697667 Fixed guessing a template info for exceptions 2014-10-10 12:27:07 +02:00
Martin Hasoň 0e7cec5ece Fixed resetting debug info in compiler 2014-10-10 12:25:51 +02:00