Commit Graph

1985 Commits

Author SHA1 Message Date
Jannis Grimm c890cf2b64 Fixed existing tests 2011-07-25 22:29:47 +02:00
Jannis Grimm 9822ac491e Changed Module.php to pass existing tests 2011-07-25 22:12:48 +02:00
Fabien Potencier 53eca627a6 simplified CHANGELOG 2011-07-25 18:46:01 +02:00
Fabien Potencier b42d8f3e29 updated CHANGELOG 2011-07-25 18:14:12 +02:00
Fabien Potencier ea83972869 fixed output when a macro throws an exception 2011-07-25 18:12:59 +02:00
Fabien Potencier 42e4105595 fixed PHPDocs for the Token parsers 2011-07-25 18:05:31 +02:00
Fabien Potencier e3bd4bdcdd fixed PHPDocs for the Core extension 2011-07-25 17:56:29 +02:00
Derick Rethans 8e11c14a5f Sigh, stupid copy and paste error prevented the last tests from passing. All is well now. 2011-07-25 16:34:13 +01:00
Derick Rethans 2dffee98e9 Added a return so that the function ends after throwing an exception. This fixes a segfault too. 2011-07-25 16:24:38 +01:00
Fabien Potencier e08de0d7cf merged branch pulse00/master (PR #389)
Commits
-------

351910b added twig comments
2b7e8d9 added phpDocs for TokenParsers, filters and tests

Discussion
----------

PHPDocs updated

fixed copy/paste errors and added docs to Sandbox and Use tags
2011-07-25 15:52:46 +02:00
Fabien Potencier 6783d5812b fixed a parsing problem when a large chunk of text is enclosed in a comment tag 2011-07-25 15:51:24 +02:00
Jannis Grimm fab8c72d08 fixed issue #395 2011-07-24 22:55:34 +02:00
Fabien Potencier e44ea9b0d4 added filename when throwing an exception when we know it 2011-07-19 15:27:34 +02:00
Derick Rethans e9c3eda05d - Fixed code that was previously never hit. 2011-07-18 18:46:39 +01:00
Derick Rethans 53e1652d80 Implement HAS_PROPERTY to distinguish between not-set and NULL. 2011-07-18 18:46:12 +01:00
Derick Rethans 541f6c8478 Use "isset" logic as fetch always works, even for elements that don't exist and they then just become NULL. 2011-07-18 18:45:31 +01:00
Robert Gruendler 351910bf21 added twig comments 2011-07-18 14:35:57 +02:00
Robert Gruendler 2b7e8d9da9 added phpDocs for TokenParsers, filters and tests 2011-07-18 13:32:46 +02:00
Fabien Potencier 94ac20f155 prepared 1.1.1 release v1.1.1 2011-07-17 15:53:10 +02:00
Fabien Potencier d95aeed935 made a small optimization on Core functions 2011-07-16 21:08:20 +02:00
Fabien Potencier a27175b76a added an optimization to the Optimizer 2011-07-16 20:38:00 +02:00
Derick Rethans a36d11ba0c Fixed memory leaks. 2011-07-15 14:16:25 +01:00
Derick Rethans cbd975ae0c Use the proper zend hash function here. 2011-07-14 12:18:50 +01:00
Derick Rethans 7b38766928 Handle numeric keys for array elements too. 2011-07-14 12:15:50 +01:00
Derick Rethans 49b885c170 After instantiating the object, call the constructor and make sure we return from the function. 2011-07-13 18:20:47 +01:00
Derick Rethans 0ee71a722e Added TWIG_CALL_Z (to use for calling a function with one argument). 2011-07-13 18:20:21 +01:00
Derick Rethans 52b9ae44bb Bailout when we have an exception to defer to PHP's exception handlers. 2011-07-13 16:27:35 +01:00
Derick Rethans 9facb8d991 Split TWIG_CALL_S into TWIG_CALL_S and TWIG_CALL_SB for boolean returning functions. 2011-07-13 16:27:10 +01:00
Fabien Potencier 2527c6564b updated CHANGELOG 2011-07-12 10:04:49 +02:00
Fabien Potencier 2f3dd84890 fixed CS 2011-07-12 09:50:37 +02:00
Fabien Potencier 90d99a7737 merged branch nikic/improveIsDefinedPerformanceInNonStrictMode (PR #381)
Commits
-------

e4b8371 Improve performance of is defined in non strict mode

Discussion
----------

Improve performance of is defined in non strict mode

Addresses issue #380: This gives a good performance improvement on defined tests in non-strict code. About 2x.

Reasoning: It doesn't make sense to propagate the `is_defined_test` flag into deeper levels in non-strict mode, because all getAttr functions and name accesses will just return `null` if it doesn't exist and `null` is just as good as `false`.

---------------------------------------------------------------------------

by nikic at 2011/07/02 03:22:53 -0700

Though, do not merge yet please. Changes behavior concerning methods.

---------------------------------------------------------------------------

by nikic at 2011/07/02 13:34:32 -0700

Hm, I really don't know what I was thinking when I wrote my last comment. There shouldn't be any behavior changes introduced by that change (and tests pass).
2011-07-12 09:49:44 +02:00
Fabien Potencier 0ef96f6b1d merged branch nikic/optimizeVariableAccess2 (PR #382)
Commits
-------

5b91f12 Update tests
a5ef326 Use Template->getContext in non-strict mode too

Discussion
----------

Use Template->getContext() when in non-strict mode, too

As described in #380 using the current `isset($context['test']) ? $context['test'] : null` approach can cause problems in some cases: The ternary operator always returns by value and thus PHP's copy-on-write concept does not apply. So `$context['test']` needs to be copied in any case, even though a write never happens to it. Basically Twig is copying the values of all variables ever used inside Twig if it operates in non-strict mode. This is problematic when `$context['test']` contains big arrays as the whole array is copied.

In this patch I change Twig to use `Template->getContext` when in non-strict mode too and add an `isStrictVariables` check in there.
2011-07-12 09:49:06 +02:00
Fabien Potencier 24d83b3c59 merged branch real-chocopanda/ob_fix (PR #379)
Commits
-------

75748a5 revert accidental mode change
681d2b8 fix nested buffers issue #374

Discussion
----------

fix nested buffers issue #374

see #374 for details

---------------------------------------------------------------------------

by fabpot at 2011/07/09 01:02:50 -0700

You have inadvertently changed the mode to 0755. Should stay at 0644.

---------------------------------------------------------------------------

by macolu at 2011/07/09 03:07:42 -0700

Mode change reverted.

About this Windows bug... Are you talking about the zlib issue? When zlib compression is activated, it adds a buffer level that ob_end_clean() can't close. So  ob_get_level() never go below 1.

http://cksource.com/forums/viewtopic.php?t=21653
http://www.php.net/manual/fr/function.ob-get-level.php#52945

In that case, the first ob_get_level() call will always return something greater than 0. So $level var will be > 0. This should avoid infinite loops.
2011-07-11 18:54:11 +02:00
Fabien Potencier 352923e605 updated VERSION 2011-07-11 18:53:57 +02:00
Matthieu Robin 75748a5178 revert accidental mode change 2011-07-09 11:34:52 +02:00
Derick Rethans b8b89f61a6 Fixed the uninitialized ptr check. This makes all tests in Twig_TemplateTest pass! 2011-07-08 13:01:22 +01:00
Derick Rethans 9096e3f734 Use strtolower on the method names and add them as associative keys so that they are found.
This makes method calls work.
2011-07-08 12:50:26 +01:00
Derick Rethans 0b6cefbb6a Fixed TWIG_PROPERTY to return a NULL instead of a zval(NULL). 2011-07-07 15:43:13 +01:00
Derick Rethans 1e726f436b Those are array elements and not properties. 2011-07-07 14:06:18 +01:00
Derick Rethans 9f6495f447 Return the value immediately. 2011-07-07 14:06:03 +01:00
Derick Rethans f7ae76ef4b Check the property regardless of whether tmp_item is valid/set. 2011-07-07 14:05:38 +01:00
Derick Rethans 3c208ff875 We need to use strlen on hash keys. 2011-07-07 14:05:21 +01:00
Derick Rethans 7d36defef3 Split TWIG_PROPERTY into TWIG_PROPERTY and TWIG_PROPERTY_CHAR so the array key can be both a zval or char. 2011-07-07 14:04:53 +01:00
Derick Rethans 508bb66bf7 Made properties return properly. 2011-07-07 13:06:13 +01:00
Derick Rethans 4e899caee4 Add the properties as assoc keys, so that hash_find actually works on them. 2011-07-07 13:05:40 +01:00
Derick Rethans 63e1f1279d Check normal property before trying to de-mangle it. 2011-07-07 13:05:12 +01:00
Derick Rethans 9d22fddf08 Fixed TWIG_GET_ARRAY_ELEMENT_ZVAL's return value. 2011-07-07 13:04:50 +01:00
Derick Rethans 48b0a5f985 Fixed compiler warning. 2011-07-05 12:37:26 +01:00
Derick Rethans f19ec8a090 Implemented first bit for ArrayAccess support. 2011-07-05 12:37:08 +01:00
Derick Rethans f196f01704 Initialise variable to NULL. 2011-07-04 18:02:39 +01:00