Fabien Potencier [Sat, 3 Dec 2011 07:16:26 +0000]
fixed macros containing filter tag calls
Fabien Potencier [Fri, 2 Dec 2011 14:11:24 +0000]
merged branch hason/arrayloader (PR #542)
Commits
-------
16d7800 fixed a crash when an object with __toString() method is passed as template name
Discussion
----------
fixed a crash when an object with __toString() method is passed as templ...
...ate name
---------------------------------------------------------------------------
by fabpot at 2011/12/01 03:58:47 -0800
Not sure about this one as the phpdoc clearly state that the name is a string. Do you have a specific user case in mind?
---------------------------------------------------------------------------
by hason at 2011/12/01 04:26:47 -0800
I use the class "Twig_Loader_Chain" as template loader in Symfony2 application. One of the embeded loaders is "Twig_Loader_Array". In Symfony2 is used "Symfony\Component\Templating\TemplateReferenceInterface" for internal representation of a template and it causes a crash.
Martin Hasoň [Thu, 1 Dec 2011 11:43:07 +0000]
fixed a crash when an object with __toString() method is passed as template name
Fabien Potencier [Tue, 29 Nov 2011 14:49:51 +0000]
fixed markup in doc
Fabien Potencier [Sun, 27 Nov 2011 19:32:27 +0000]
prepared the 1.4.0-RC2 release
Fabien Potencier [Sun, 27 Nov 2011 15:46:10 +0000]
merged branch arnaud-lb/twig-escape-filter-opt (PR #537)
Commits
-------
7b8d476 optimized twig_escape_filter
Discussion
----------
Optimized twig_escape_filter
This optimizes the part of twig_escape_filter that checks if the charset is supported by htmlspecialchars.
This uses a static variable to avoid initializing the charsets array each time the function is called; and does a hash lookup instead of array search (saves a function call too).
The optimized version takes 66% less time that the original version on html escaping :) (no difference on js escaping).
Arnaud Le Blanc [Sun, 27 Nov 2011 15:13:43 +0000]
optimized twig_escape_filter
uses a static variable to avoid initializing the charsets array each
time the function is called; and does a hash lookup instead of array
search (saves a function call too).
Fabien Potencier [Sun, 27 Nov 2011 13:58:28 +0000]
simplified the implementation of the replace filter
Fabien Potencier [Fri, 25 Nov 2011 18:36:25 +0000]
fixed a crash under certain versions of PHP when an object with a __toString() method is used with htmlspecialchars
Fabien Potencier [Wed, 23 Nov 2011 22:45:02 +0000]
renamed an internal class
Fabien Potencier [Wed, 23 Nov 2011 14:18:40 +0000]
made a small speed optimization
Fabien Potencier [Wed, 23 Nov 2011 13:24:45 +0000]
fixed unit tests due to a difference between the PHP and C versions of Twig_Template::getAttribute()
Fabien Potencier [Wed, 23 Nov 2011 13:14:41 +0000]
merged branch arnaud-lb/ext (PR #530)
Commits
-------
569f782 fix ZTS build
1606910 Fix undefined behavior
0ce8d3c Convert item argument to string
d807981 don't try to access non public property or method
7e566b8 test twig_template_get_attributes
Discussion
----------
twig_template_get_attributes tests and fixes
This enables testing of twig_template_get_attributes (every TemplateTest test is ran against twig_template_get_attributes too) and fixes some bugs I've found.
There is still 3 failing tests due to a difference of how twig_template_get_attributes and Twig_Template::getAttribute use Twig_Template::$cache.
Twig_Template::getAttribute doesn't cache properties, and twig_template_get_attributes expects $cache[$class]['properties'] to be set if $cache[$class] is set. So twig_template_get_attributes can fail if the cache is already populated by Twig_Template::getAttribute.
Arnaud Le Blanc [Wed, 23 Nov 2011 13:01:51 +0000]
fix ZTS build
Arnaud Le Blanc [Wed, 23 Nov 2011 11:38:55 +0000]
Fix undefined behavior
The callbacks are expected to return an integer, and returning void
instead was triggering weird bugs
I've also removed the casts to ensure that the signatures are compatible
Arnaud Le Blanc [Tue, 22 Nov 2011 22:11:21 +0000]
Convert item argument to string
This fixes a crash in some cases and repeated conversions
Arnaud Le Blanc [Tue, 22 Nov 2011 20:58:47 +0000]
don't try to access non public property or method
Arnaud Le Blanc [Wed, 23 Nov 2011 12:17:33 +0000]
test twig_template_get_attributes
Fabien Potencier [Wed, 23 Nov 2011 11:21:50 +0000]
tweaked CHANGELOG
Fabien Potencier [Wed, 23 Nov 2011 11:19:09 +0000]
updated Twig ext version
Fabien Potencier [Wed, 23 Nov 2011 11:16:47 +0000]
merged branch arjenjb/master (PR #528)
Commits
-------
c65be3e Pass around the TSRM
09d3095 Moved zval declaration
c941552 Removed globals
ffb2460 Added config.w32 for windows builds
Discussion
----------
Fixed compilation on windows
Fabien Potencier [Wed, 23 Nov 2011 11:11:28 +0000]
merged branch derickr/master (PR #526)
Commits
-------
c4a7d19 Merge branch 'master' of github.com:derickr/twig-ext
7d37d66 Make the extension ZTS-proof.
9879ca2 Merge branch 'master' of github.com:derickr/twig-ext
40ec671 Fixed name in license.
Discussion
----------
Added ZTS (windows TS) support
Hi!
Seemed that since last time I tested, I forgot to sprinkle in some TSRMLS calls all over the place for ZTS support.
This pull request pulls that in, as well as my previous name-in-license change.
Derick
---------------------------------------------------------------------------
by fabpot at 2011/11/21 03:19:09 -0800
@derickr: Now that the extension is in the Twig repo, can you work there directly so that we can avoid the merge commits?
---------------------------------------------------------------------------
by derickr at 2011/11/21 03:22:54 -0800
On Mon, 21 Nov 2011, Fabien Potencier wrote:
> @derickr: Now that the extension is in the Twig repo, can you work there directly so that we can avoid the merge commits?
Will do that form now on.
Derick
---------------------------------------------------------------------------
by stealth35 at 2011/11/21 04:42:14 -0800
@derickr could you add the `config.w32`, and fix the `php_twig.h` ?
---------------------------------------------------------------------------
by stealth35 at 2011/11/21 07:03:53 -0800
You also need to fix `php_twig.h`, like :
``` c
ZEND_BEGIN_MODULE_GLOBALS(twig)
long global_value;
ZEND_END_MODULE_GLOBALS(twig)
```
and move `zval *tmp_self_cache;` ([@L828][1]) in the top of the function (after `zval *ret = NULL;` ([@L708][2]) for example)
Now build seem to be OK, all tests pass under Windows
I have a complied version if some people are interest to testing :
https://github.com/downloads/stealth35/stealth35.github.com/php_twig-5.3-vc9-x86.zip
[1]: https://github.com/derickr/Twig/blob/
c4a7d1983dab7e2818cca3c4896704f4fce7becc/ext/twig/twig.c#L828
[2]: https://github.com/derickr/Twig/blob/
c4a7d1983dab7e2818cca3c4896704f4fce7becc/ext/twig/twig.c#L708
---------------------------------------------------------------------------
by stealth35 at 2011/11/21 07:06:42 -0800
@fabpot any plan for the version number ? actually it's v0.0.1, sould it be the same as Twig ?
Fabien Potencier [Wed, 23 Nov 2011 11:06:36 +0000]
merged branch Tobion/patch-1 (PR #529)
Commits
-------
4802f69 fixing and improving PHPDoc in Template.php
Discussion
----------
fixing and improving PHPDoc in Template.php
Tobias Schultze [Tue, 22 Nov 2011 08:11:56 +0000]
fixing and improving PHPDoc in Template.php
Arjen Brouwer [Mon, 21 Nov 2011 23:17:40 +0000]
Pass around the TSRM
Arjen Brouwer [Mon, 21 Nov 2011 22:57:44 +0000]
Moved zval declaration
Arjen Brouwer [Mon, 21 Nov 2011 22:56:11 +0000]
Removed globals
Arjen Brouwer [Mon, 21 Nov 2011 22:54:57 +0000]
Added config.w32 for windows builds
Fabien Potencier [Mon, 21 Nov 2011 13:31:08 +0000]
added more unit tests
Fabien Potencier [Mon, 21 Nov 2011 13:06:01 +0000]
merged branch pierrejoye/master (PR #527)
Commits
-------
115edf2 - fix property access when the instance implements Iterator or similar cases, by using get_object_vars instead, thx Arnaud Leblanc for the hint.
Discussion
----------
Fix props detection for instances implementing Iterator or similar cases
Fix property access when the instance implements Iterator or similar cases, by using get_object_vars instead, thx Arnaud Leblanc for the hint.
Pierre Joye [Mon, 21 Nov 2011 13:02:02 +0000]
- fix property access when the instance implements Iterator or similar cases, by using get_object_vars instead, thx Arnaud Leblanc for the hint.
Derick Rethans [Mon, 21 Nov 2011 11:09:34 +0000]
Merge branch 'master' of github.com:derickr/twig-ext
Conflicts:
ext/twig/twig.c
Derick Rethans [Mon, 21 Nov 2011 11:08:17 +0000]
Make the extension ZTS-proof.
Fabien Potencier [Mon, 21 Nov 2011 09:36:47 +0000]
removed usage of Reflection in Twig_Template::getAttribute() (thanks Pierre Joye for the property tip)
Derick Rethans [Mon, 21 Nov 2011 08:34:59 +0000]
Fixed name in license.
Fabien Potencier [Mon, 21 Nov 2011 08:41:49 +0000]
fixed typo
Derick Rethans [Mon, 21 Nov 2011 08:37:45 +0000]
Merge branch 'master' of github.com:derickr/twig-ext
Fabien Potencier [Sat, 10 Sep 2011 09:35:39 +0000]
added support for twig C extension
Derick Rethans [Mon, 21 Nov 2011 08:34:59 +0000]
Fixed name in license.
Fabien Potencier [Mon, 21 Nov 2011 08:34:50 +0000]
merged branch derickr/master (PR #524)
Commits
-------
229c07c Added another workaround for PHP 5.4 support.
c4055d2 Merge branch 'master' of github.com:derickr/twig-ext
f7f8346 Switch LICENSE to Revised BSD.
16ca055 Move files into ext/twig.
699e123 Allow any, but the first two arguments to be optional.
952fe6f Added missing format specifier to parseparameters.
7cc2808 Added support for the new argument called 'ignoreStrictCheck'.
b7b260b Fixed exception message issue with an array element that didn't exist and strict variables checking turned on.
634d8ae Fixed compiler warnings
7077811 PHP 5.4 compatibility.
05cb73f More PHP 5.2 compatibility.
163f806 PHP 5.2 compatibility.
8e11c14 Sigh, stupid copy and paste error prevented the last tests from passing. All is well now.
2dffee9 Added a return so that the function ends after throwing an exception. This fixes a segfault too.
e9c3eda - Fixed code that was previously never hit.
53e1652 Implement HAS_PROPERTY to distinguish between not-set and NULL.
541f6c8 Use "isset" logic as fetch always works, even for elements that don't exist and they then just become NULL.
a36d11b Fixed memory leaks.
cbd975a Use the proper zend hash function here.
7b38766 Handle numeric keys for array elements too.
49b885c After instantiating the object, call the constructor and make sure we return from the function.
0ee71a7 Added TWIG_CALL_Z (to use for calling a function with one argument).
52b9ae4 Bailout when we have an exception to defer to PHP's exception handlers.
9facb8d Split TWIG_CALL_S into TWIG_CALL_S and TWIG_CALL_SB for boolean returning functions.
b8b89f6 Fixed the uninitialized ptr check. This makes all tests in Twig_TemplateTest pass!
9096e3f Use strtolower on the method names and add them as associative keys so that they are found.
0b6cefb Fixed TWIG_PROPERTY to return a NULL instead of a zval(NULL).
1e726f4 Those are array elements and not properties.
9f6495f Return the value immediately.
f7ae76e Check the property regardless of whether tmp_item is valid/set.
3c208ff We need to use strlen on hash keys.
7d36def Split TWIG_PROPERTY into TWIG_PROPERTY and TWIG_PROPERTY_CHAR so the array key can be both a zval or char.
508bb66 Made properties return properly.
4e899ca Add the properties as assoc keys, so that hash_find actually works on them.
63e1f12 Check normal property before trying to de-mangle it.
9d22fdd Fixed TWIG_GET_ARRAY_ELEMENT_ZVAL's return value.
48b0a5f Fixed compiler warning.
f19ec8a Implemented first bit for ArrayAccess support.
f196f01 Initialise variable to NULL.
803c1a9 Apparently this is needed for GCC to not optimise it out...
078690b - Remove debugging code.
1b55c97 Only add the object to the cache if there is actually an object.
f42cd14 Fix efree(NULL) when no arguments are passed in.
577169c Added missing header and switch arguments for the return around as I got that wrong.
2b58fec Added support for NULL arguments to CALL_USER_FUNC_ARRAY and made CALL_BOOLEAN use that.
f7fc1ff Fold TWIG_GET_ARRAY_ELEMENT and TWIG_PROPERTY into one worker function.
6e1dd56 Implement TWIG_GET_CLASS_NAME and make use of it.
b891ad9 Initialise ret to NULL.
828c113 Get rid of TWIG_RETURN_ARRAY_ELEMENT and use TWIG_GET_ARRAY_ELEMENT instead.
0cc719a Implemented TWIG_THROW_EXCEPTION.
701be8b Implemented TWIG_IMPLODE_ARRAY_KEYS.
3da24d9 Fixed logic and implemented normal array key return.
b918f2e Implemented TWIG_RETURN_ARRAY_ELEMENT.
e1663e8 Re-scope variables.
8bc1f02 Added the cache creating/fetching method in the code.
7367cf9 Added the cache fetching method for methods and properties.
9d40c9f Implemented TWIG_CALL_USER_FUNC_ARRAY, TWIG_GET_STATIC_PROPERTY, TWIG_GET_ARRAY_ELEMENT_ZVAL and TWIG_GET_ARRAY_ELEMENT.
2078e50 - Implemented the strtolower function.
e133074 - The extension now loads and the pseudo code is mostly ready.
1b96539 - The parse parameters line was wrong, it still had the extra one that was removed in Twig itself already.
d082244 - Used the template, instead of getThis(), which wouldn't exist.
07e38ef - Added more generated files to .gitignore
6aa1a64 - Stubs and more implementations.
79f6dc6 - Implement TWIG_INSTANCEOF_*
19fbee7 - Implemented TWIG_ARRAY_KEY_EXISTS (for normal arrays only).
4de3659 - Reduce compile warnings and errors. - Initialize the two method names.
a2f3c34 - Added more files to .gitignore
fad8e9a - Fixed ARG INFO
15de533 - Added pseudo code
bfc6e34 - Added a .gitignore file
75d3e66 - Updated with new code from Fabien's repository.
6edc311 - Some scaffolding implementation.
979d6ec - Added broken down original code.
e19701d - Added function declaration and headers.
430aecf - Added basic twig extension structure.
Discussion
----------
The twig extension put into ext/twig.
Hi!
Here is the twig extension as pull-request. I'll make a separate pull request for the PHP 5.4 issue that you mailed.
cheers,
Derick
---------------------------------------------------------------------------
by fzaninotto at 2011/11/20 13:40:07 -0800
Incredible!
Question: What's the plan for maintaining this as the PHP code continues to evolve?
---------------------------------------------------------------------------
by derickr at 2011/11/20 13:43:47 -0800
@fzninotto: That's still something that we need to figure out. It's just one method but yes, it does need to keep updated if the PHP's code semantics change of course.
---------------------------------------------------------------------------
by stof at 2011/11/20 13:50:03 -0800
This should be done as a separate repo IMO. People using the PHP version of Twig really don't need all the C code when cloning.
---------------------------------------------------------------------------
by derickr at 2011/11/20 13:53:23 -0800
@stof That's what I thought too, but Fabien asked me to do this. I've a repository for just the ext at https://github.com/derickr/twig-ext
---------------------------------------------------------------------------
by stof at 2011/11/20 13:54:00 -0800
@derick the link you gave is a 404
---------------------------------------------------------------------------
by derickr at 2011/11/20 14:00:36 -0800
@stof Ah, it was still private. *fixed*
---------------------------------------------------------------------------
by hhamon at 2011/11/20 21:05:49 -0800
That's awesome!!!
---------------------------------------------------------------------------
by beberlei at 2011/11/20 22:37:40 -0800
<3
---------------------------------------------------------------------------
by jmikola at 2011/11/20 22:42:45 -0800
:+1:
---------------------------------------------------------------------------
by dustinwhittle at 2011/11/20 22:51:37 -0800
Thanks for porting!
---------------------------------------------------------------------------
by trompette at 2011/11/20 23:28:54 -0800
It needs some serious documentation effort, bat that's awsome!
---------------------------------------------------------------------------
by fabpot at 2011/11/20 23:43:42 -0800
@stof: this is really just 3 small files, so it does not hurt to have them in the main repo. Having just one repo also eases the maintenance ans usage as when you switch from one version to another, you are sure to have the right version of the C code as well.
@fzaninotto: SensioLabs sponsored the port of the `Twig_Template::getAttribute()` method as this is the biggest bottleneck for Twig. The maintenance should probably be done by the community from now on; but anyway, SensioLabs will continue to sponsor it if needed.
---------------------------------------------------------------------------
by henrikbjorn at 2011/11/20 23:56:46 -0800
Have any gotten this to build succesfully ?
---------------------------------------------------------------------------
by fabpot at 2011/11/21 00:06:15 -0800
@henrikbjorn: we have tested it on PHP 5.2/5.3/5.4 on both Linux and Mac (we have not tried it on Windows though).
---------------------------------------------------------------------------
by tecbot at 2011/11/21 00:33:05 -0800
:+1:
Fabien Potencier [Mon, 21 Nov 2011 08:02:49 +0000]
fixed previous merge and added some unit tests
Fabien Potencier [Mon, 21 Nov 2011 07:53:51 +0000]
merged branch shvchk/patch-2 (PR #522)
Commits
-------
5f30db0 !empty($date[0]) → !empty($date)
0182dbc indentation fix
c7a06cb php warning fix
a4a2d6f Support of negative timestamps
Discussion
----------
Support of negative timestamps
Date could be checked against this condition, as proposed in my patch:
```php
ctype_digit((string) $date)
|| (('-' === $date[0])
&& (ctype_digit(substr($date, 1))))
```
or this:
```php
preg_match('/^\-?\d+/', $date)
```
Second is maybe more readable, but 20% slower.
---------------------------------------------------------------------------
by nikic at 2011/11/20 01:59:16 -0800
Couldn't we do an int validation here? I.e. `if (false !== filter_var($date, FILTER_VALIDATE_INT)) { ... }`. That will allow both positive and negative integers in the allowed integer range. Note though that it will no longer allow ints starting with a zero (apart from zero itself). To support that one would need to pass the ALLOW_OCTAL flag.
Some tests: http://codepad.viper-7.com/w0MDTH
---------------------------------------------------------------------------
by damianb at 2011/11/20 07:50:39 -0800
@nikic why not `ctype_digit`?
---------------------------------------------------------------------------
by nikic at 2011/11/20 07:53:26 -0800
@damianb ctype_digit is what this PR wants to replace, because it does not allow negative numbers. Replacing it with `ctype_digit((string) $date) || (!empty($date[0]) && ('-' === $date[0]) && ctype_digit(substr($date, 1)))` seems like overkill to me though, that's why I proposed to use `false !== filter_var($date, FILTER_VALIDATE_INT)` instead, which apart from being shorter is also semantically more correct.
---------------------------------------------------------------------------
by damianb at 2011/11/20 08:03:09 -0800
@nikic But does filter_var with FILTER_VALIDATE_INT perform better than what's proposed?
Also, I would think that the `empty($date[0])` should just be replaced with an empty check on the `$date` var itself - seems quite pointless to check if the first character is empty, that'd imply that either a) the string itself is empty b) `date[0] == 0`, which could result in a nasty gotcha for someone down the road.
---------------------------------------------------------------------------
by shvchk at 2011/11/20 09:36:17 -0800
@damianb, you are right, I will update the code.
@nikic, on 32-bit systems ```PHP_INT_MAX``` is ```
2147483647```, so your code will fail on such systems for 01.01.1900, for example, which is ```-
2208988800``` and is not that rarely used.
Derick Rethans [Sun, 20 Nov 2011 21:41:07 +0000]
Added another workaround for PHP 5.4 support.
Derick Rethans [Sun, 20 Nov 2011 21:29:14 +0000]
Merge branch 'master' of github.com:derickr/twig-ext
Derick Rethans [Sun, 20 Nov 2011 21:26:21 +0000]
Switch LICENSE to Revised BSD.
Derick Rethans [Sun, 20 Nov 2011 21:25:05 +0000]
Move files into ext/twig.
Andrei Shevchuk [Sun, 20 Nov 2011 17:39:44 +0000]
!empty($date[0]) → !empty($date)
Andrei Shevchuk [Sun, 20 Nov 2011 11:26:45 +0000]
indentation fix
Andrei Shevchuk [Sun, 20 Nov 2011 11:18:57 +0000]
php warning fix
Fabien Potencier [Sun, 20 Nov 2011 09:41:28 +0000]
prepared the 1.4.0-RC1 release
Fabien Potencier [Sun, 20 Nov 2011 09:26:23 +0000]
adding more structure to the for doc
Fabien Potencier [Sun, 20 Nov 2011 09:20:20 +0000]
added a note about using the loop variable in a for condition
Andrei Shevchuk [Sun, 20 Nov 2011 09:08:58 +0000]
Support of negative timestamps
Fabien Potencier [Fri, 18 Nov 2011 20:54:44 +0000]
optimized variable access when using PHP 5.4
Fabien Potencier [Wed, 16 Nov 2011 07:07:47 +0000]
fixed a warning (PHP 5.4)
Fabien Potencier [Sat, 12 Nov 2011 11:18:12 +0000]
merged branch arnaud-lb/test-fix (PR #513)
Commits
-------
9b4e298 fixed failing test
Discussion
----------
fixed failing test
Arnaud Le Blanc [Sat, 12 Nov 2011 11:01:31 +0000]
fixed failing test
Fabien Potencier [Thu, 10 Nov 2011 11:53:56 +0000]
fixed typo
Fabien Potencier [Tue, 8 Nov 2011 12:22:31 +0000]
merged branch henrikbjorn/composer-autoload (PR #509)
Commits
-------
cf66a05 Add Autoloadig instructions for Composer
Discussion
----------
Add Autoloadig instructions for Composer
Add psr-0 autoload directive to composer.json for easier Autoloading
when using Composer as a package management tool
Henrik Bjørnskov [Tue, 8 Nov 2011 10:58:02 +0000]
Add Autoloadig instructions for Composer
Add psr-0 autoload directive to composer.json for easier Autoloading
when using Composer as a package management tool
Fabien Potencier [Mon, 7 Nov 2011 21:27:18 +0000]
merged branch craue/patch-1 (PR #507)
Commits
-------
98a859b fixed link name for `extends` tag
Discussion
----------
fixed link name for `extends` tag
Christian Raue [Mon, 7 Nov 2011 21:04:12 +0000]
fixed link name for `extends` tag
Fabien Potencier [Mon, 7 Nov 2011 19:00:46 +0000]
removed json_encode call in Twig_Error when the filename is a string (to avoid the escaping of /)
Fabien Potencier [Mon, 7 Nov 2011 13:46:38 +0000]
fixed operator precedences in the doc
Fabien Potencier [Mon, 7 Nov 2011 13:18:48 +0000]
converted item parameter of Twig_Template::getAttribute() to string
Fabien Potencier [Sat, 5 Nov 2011 08:49:18 +0000]
fixed for tag loop variable when using a condition
Fabien Potencier [Sat, 5 Nov 2011 07:54:48 +0000]
refactored "for" tag (moved some logic from the token parser to the node)
Fabien Potencier [Sat, 5 Nov 2011 07:30:08 +0000]
changed the precedence of the .. operator
Fabien Potencier [Sat, 5 Nov 2011 07:07:20 +0000]
fixed a typo in the doc
Fabien Potencier [Sat, 5 Nov 2011 07:03:53 +0000]
updated CHANGELOG
Fabien Potencier [Sat, 5 Nov 2011 07:02:41 +0000]
merged branch hason/arrayloader (PR #496)
Commits
-------
253f813 added an exception for undefined templates in ArrayLoader::isFresh
Discussion
----------
added an exception for undefined templates in ArrayLoader::isFresh
Fabien Potencier [Sat, 5 Nov 2011 07:01:41 +0000]
merged branch trompette/patch-2 (PR #501)
Commits
-------
36020a9 typo
Discussion
----------
typo
Benoît Merlet [Fri, 4 Nov 2011 23:48:00 +0000]
typo
Fabien Potencier [Fri, 4 Nov 2011 12:32:43 +0000]
fixed for tag when using a condition with strict_variables set to false
Martin Hasoň [Thu, 3 Nov 2011 11:01:29 +0000]
added an exception for undefined templates in ArrayLoader::isFresh
Fabien Potencier [Tue, 1 Nov 2011 10:54:32 +0000]
refactored code
Fabien Potencier [Tue, 1 Nov 2011 10:49:04 +0000]
added Twig_Function_Node to allow more complex functions to have their own Node class
Fabien Potencier [Tue, 1 Nov 2011 08:31:49 +0000]
added Twig_Filter_Node to allow more complex tests to have their own Node class (the default filter has been converted to use this new feature)
Fabien Potencier [Tue, 1 Nov 2011 10:29:09 +0000]
removed a function that is not used anymore
Fabien Potencier [Tue, 1 Nov 2011 07:57:23 +0000]
migrated most tests to proper Node classes
Fabien Potencier [Tue, 1 Nov 2011 07:43:09 +0000]
moved the defined test to a Twig_Test_Node class
Fabien Potencier [Mon, 31 Oct 2011 19:57:30 +0000]
added Twig_Test_Node to allow more complex tests to have their own Node class (sameas has been converted as an example)
Fabien Potencier [Mon, 31 Oct 2011 17:46:05 +0000]
added a better error message when a template is empty but contain a BOM
Fabien Potencier [Mon, 31 Oct 2011 08:05:09 +0000]
optimized tokenizer by pre-computing all start tag positions (memory and CPU)
Fabien Potencier [Sun, 30 Oct 2011 22:07:03 +0000]
optimized a comparison in the tokenizer
Fabien Potencier [Sun, 30 Oct 2011 13:47:32 +0000]
added notes in the doc about how the defined test and the default filter work
Fabien Potencier [Sun, 30 Oct 2011 13:46:53 +0000]
merged branch nikic/allowIsDefinedOnMethods (PR #490)
Commits
-------
930330f Allow defined test and default filter on methods
Discussion
----------
Allow defined test and default filter on methods
Patch for #487.
---------------------------------------------------------------------------
by fabpot at 2011/10/30 03:45:49 -0700
Problem is when some of the arguments reference variables that do not exist (`foo.bar(bar.foobar)`). That's why I've added the check on arguments.
---------------------------------------------------------------------------
by nikic at 2011/10/30 03:58:58 -0700
@fabpot I'm not exactly sure what is the expected behavior in that case. When writing `foo.defined(undefined)|default()` I think an exception is the expected behavior (because there is an undefined variable without default, even if it is in the method arguments). With `foo.undefined(undefined)|default()` on the other hand I'm not sure. One could argue that as the method does not exist the arguments never need to be evaluated.
---------------------------------------------------------------------------
by fabpot at 2011/10/30 05:49:46 -0700
The same code is used for the `defined` test: what would be the expected behavior for `foo.defined(underfined) is defined`?
Fabien Potencier [Sun, 30 Oct 2011 10:43:00 +0000]
merged branch nikic/patch-1 (PR #489)
Commits
-------
7da9f2f Make long var/block tests faster
Discussion
----------
Make long var/block tests faster
When using `*` every single character is a different token, whereas with `x` there is only a single token. I don't think this hurts the actual test, but it improves the test runtime by something like 2/3 seconds on my machine.
nikic [Sun, 30 Oct 2011 10:19:27 +0000]
Allow defined test and default filter on methods
nikic [Sun, 30 Oct 2011 10:03:56 +0000]
Make long var/block tests faster
Fabien Potencier [Sat, 29 Oct 2011 13:12:58 +0000]
fixed previous commit
Fabien Potencier [Sat, 29 Oct 2011 12:56:00 +0000]
renamed none to null in doc
Fabien Potencier [Sat, 29 Oct 2011 12:53:37 +0000]
changed the documentation to advertize null as begin the null value and none as an alias
Fabien Potencier [Sat, 29 Oct 2011 12:50:10 +0000]
fixed in operator for empty strings
Fabien Potencier [Sat, 29 Oct 2011 12:38:23 +0000]
merged branch nikic/updateExtensionDocs (PR #488)
Commits
-------
2ebc788 Update extension docs and interface
Discussion
----------
Update extension docs and interface
Followup to #484: Twig isn't using globals for functions anymore.
nikic [Sat, 29 Oct 2011 12:05:14 +0000]
Update extension docs and interface
Twig isn't using globals for functions anymore.
Fabien Potencier [Fri, 28 Oct 2011 15:23:01 +0000]
fixed typo in doc
Derick Rethans [Fri, 28 Oct 2011 10:25:41 +0000]
Allow any, but the first two arguments to be optional.
Derick Rethans [Fri, 28 Oct 2011 10:22:28 +0000]
Added missing format specifier to parseparameters.
Derick Rethans [Fri, 28 Oct 2011 10:20:22 +0000]
Added support for the new argument called 'ignoreStrictCheck'.