Fabien Potencier [Wed, 27 Jul 2011 07:36:26 +0000]
updated CHANGELOG
Fabien Potencier [Wed, 27 Jul 2011 07:34:28 +0000]
fixed previous merge
Fabien Potencier [Wed, 27 Jul 2011 07:33:41 +0000]
merged branch hason/optimizer (PR #399)
Commits
-------
3c5c512 fixed optimization for rendering blocks with variable name
Discussion
----------
Fixed bug in optimization
Martin Hason [Wed, 27 Jul 2011 06:19:59 +0000]
fixed optimization for rendering blocks with variable name
Fabien Potencier [Tue, 26 Jul 2011 15:36:37 +0000]
updated CHANGELOG
Fabien Potencier [Tue, 26 Jul 2011 15:32:54 +0000]
fixed inherited templates when an empty body
Fabien Potencier [Tue, 26 Jul 2011 15:30:32 +0000]
merged branch netzhuffle/master (PR #396)
Commits
-------
7b154d6 Switched a tab to four spaces
29d3cb2 Added testcase for #395
4fc7a8d Merge remote-tracking branch 'upstream/master'
c890cf2 Fixed existing tests
9822ac4 Changed Module.php to pass existing tests
fab8c72 fixed issue #395
Discussion
----------
Fix for issue #395
Fix for #395
I hope you can use it.
---------------------------------------------------------------------------
by fabpot at 2011/07/25 00:07:50 -0700
Can you add some unit tests?
---------------------------------------------------------------------------
by netzhuffle at 2011/07/25 13:57:55 -0700
Here you are.
Fabien Potencier [Tue, 26 Jul 2011 06:07:02 +0000]
removed comment
Fabien Potencier [Tue, 26 Jul 2011 06:02:51 +0000]
fixed compilation of templates when the body of a child template is not empty
Jannis Grimm [Mon, 25 Jul 2011 21:10:29 +0000]
Switched a tab to four spaces
Jannis Grimm [Mon, 25 Jul 2011 20:55:53 +0000]
Added testcase for #395
Jannis Grimm [Mon, 25 Jul 2011 20:32:17 +0000]
Merge remote-tracking branch 'upstream/master'
Jannis Grimm [Mon, 25 Jul 2011 20:29:47 +0000]
Fixed existing tests
Jannis Grimm [Mon, 25 Jul 2011 20:12:48 +0000]
Changed Module.php to pass existing tests
Fabien Potencier [Mon, 25 Jul 2011 16:46:01 +0000]
simplified CHANGELOG
Fabien Potencier [Mon, 25 Jul 2011 16:14:12 +0000]
updated CHANGELOG
Fabien Potencier [Mon, 25 Jul 2011 16:12:16 +0000]
fixed output when a macro throws an exception
Fabien Potencier [Mon, 25 Jul 2011 16:05:31 +0000]
fixed PHPDocs for the Token parsers
Fabien Potencier [Mon, 25 Jul 2011 15:56:29 +0000]
fixed PHPDocs for the Core extension
Fabien Potencier [Mon, 25 Jul 2011 13:52:46 +0000]
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
Fabien Potencier [Mon, 25 Jul 2011 13:51:24 +0000]
fixed a parsing problem when a large chunk of text is enclosed in a comment tag
Jannis Grimm [Sun, 24 Jul 2011 20:55:34 +0000]
fixed issue #395
Fabien Potencier [Tue, 19 Jul 2011 13:27:34 +0000]
added filename when throwing an exception when we know it
Robert Gruendler [Mon, 18 Jul 2011 12:35:57 +0000]
added twig comments
Robert Gruendler [Mon, 18 Jul 2011 11:32:46 +0000]
added phpDocs for TokenParsers, filters and tests
Fabien Potencier [Sun, 17 Jul 2011 13:53:10 +0000]
prepared 1.1.1 release
Fabien Potencier [Sat, 16 Jul 2011 19:08:20 +0000]
made a small optimization on Core functions
Fabien Potencier [Sat, 16 Jul 2011 18:37:44 +0000]
added an optimization to the Optimizer
Fabien Potencier [Tue, 12 Jul 2011 08:04:49 +0000]
updated CHANGELOG
Fabien Potencier [Tue, 12 Jul 2011 07:50:37 +0000]
fixed CS
Fabien Potencier [Tue, 12 Jul 2011 07:49:44 +0000]
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).
Fabien Potencier [Tue, 12 Jul 2011 07:49:06 +0000]
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.
Fabien Potencier [Mon, 11 Jul 2011 16:54:11 +0000]
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.
Fabien Potencier [Mon, 11 Jul 2011 16:53:57 +0000]
updated VERSION
Matthieu Robin [Sat, 9 Jul 2011 09:34:52 +0000]
revert accidental mode change
nikic [Sat, 2 Jul 2011 21:53:43 +0000]
Update tests
nikic [Sat, 2 Jul 2011 21:43:11 +0000]
Use Template->getContext in non-strict mode too
nikic [Sat, 2 Jul 2011 09:20:54 +0000]
Improve performance of is defined in non strict mode
Matthieu Robin [Fri, 1 Jul 2011 08:35:24 +0000]
fix nested buffers issue #374
Fabien Potencier [Tue, 28 Jun 2011 06:09:35 +0000]
updated CHANGELOG
Fabien Potencier [Tue, 28 Jun 2011 06:06:52 +0000]
merged branch markstory/fix-308 (PR #373)
Commits
-------
eaa8995 Grammatical fix.
Discussion
----------
Grammatical fix.
A small grammatical fix for #308 + PR #372
Mark Story [Mon, 27 Jun 2011 11:28:17 +0000]
Grammatical fix.
Fabien Potencier [Mon, 27 Jun 2011 07:29:21 +0000]
merged branch markstory/fix-308 (PR #372)
Commits
-------
c178c28 Making docs more explict as to what kind of object can be used with Twig_Function_Method. Fixes #308
Discussion
----------
Fix for #308
Making docs more explict as to what kind of object can be used with Twig_Function_Method.
Fixes #308
Mark Story [Sun, 26 Jun 2011 21:31:56 +0000]
Making docs more explict as to what kind of object can be
used with Twig_Function_Method.
Fixes #308
Fabien Potencier [Fri, 24 Jun 2011 09:26:17 +0000]
fixed json_encode filter (thanks to Koc for the fix)
Fabien Potencier [Fri, 24 Jun 2011 09:07:17 +0000]
prepare 1.1 RC3
Fabien Potencier [Fri, 24 Jun 2011 09:04:41 +0000]
fixed method case-sensitivity when using the sandbox mode
Fabien Potencier [Fri, 24 Jun 2011 08:42:46 +0000]
updated CHANGELOG
Fabien Potencier [Fri, 24 Jun 2011 08:41:55 +0000]
added doc and fixed CS for previous merge
Fabien Potencier [Fri, 24 Jun 2011 08:39:24 +0000]
merged branch jturmel/patch-1 (PR #367)
Commits
-------
6593761 Allow setting of timezone on twig_date_format_filter method
Discussion
----------
Allow setting of timezone on twig_date_format_filter method
Fabien Potencier [Fri, 24 Jun 2011 08:37:02 +0000]
added Sublime Text support in the doc
Fabien Potencier [Fri, 24 Jun 2011 08:24:14 +0000]
reworded the section on IDEs and added an Eclipse plugin
Josh Turmel [Wed, 22 Jun 2011 03:14:00 +0000]
Allow setting of timezone on twig_date_format_filter method
Fabien Potencier [Fri, 17 Jun 2011 07:17:45 +0000]
fixed possible security problems with NUL bytes
Fabien Potencier [Fri, 17 Jun 2011 05:03:39 +0000]
releasing 1.1.0 RC2
Fabien Potencier [Thu, 16 Jun 2011 08:04:13 +0000]
added Twig_Error::getRawMessage()
Fabien Potencier [Thu, 16 Jun 2011 07:57:17 +0000]
added an exception when the template passed to "use" is not a string
Fabien Potencier [Thu, 16 Jun 2011 07:45:47 +0000]
merged branch henrikbjorn/issue-347 (PR #348)
Commits
-------
a8d29b1 Add testcase for issue #347
Discussion
----------
Add testcase for issue #347
Dismisses false issue.
Fabien Potencier [Thu, 16 Jun 2011 07:45:16 +0000]
updated CHANGELOG
Fabien Potencier [Thu, 16 Jun 2011 07:41:50 +0000]
merged branch nikic/nestedDefinedTestWithStrictVars (PR #359)
Commits
-------
f2a1c2b Refactor and add additional default filter tests
e760483 Make `a.b is defined` not throw an exception if a is not defined (in strict mode)
Discussion
----------
Make `a.b is defined` not throw an exception if a is not defined (in strict mode)
This commit does two things: Firstly (that's the main part) it makes `a.b is defined` not throw an error in strict mode if `a` is undefined (applies for `a.b.c` aso too) [fixes #337]. Additionally it allows `a.b|default` just like it is allowed to do `a|default`.
---------------------------------------------------------------------------
by fabpot at 2011/06/09 22:21:11 -0700
This is quite a big change. Can you add some tests?
---------------------------------------------------------------------------
by nikic at 2011/06/10 08:19:49 -0700
I added some more tests for the default filter in the fixtures. But I wasn't sure how I should test the default test's behavior in strict mode. If you could point me in the right direction here I would add those tests, too ;)
Fabien Potencier [Thu, 16 Jun 2011 07:41:31 +0000]
updated CHANGELOG
Fabien Potencier [Thu, 16 Jun 2011 07:31:53 +0000]
merged branch arnaud-lb/line-numbers (PR #353)
Commits
-------
5ec1955 added {% line \d+ %} directive
Discussion
----------
added {% line \d+ %} directive
This directive allows to change the current line number in the tokenizer.
This allows to generate Twig code from some other Twig or partially-Twig script, and still get relevant line numbers in error messages, when the line numbers of the generated Twig script do not match those of the original script.
For example in the following script:
foo
{% line 10 %}
bar
{{ baz }}
`"foo"` is on line 1, `"bar"` is considered to be on line 10 and `{{ baz }}` is considered to be on line 11.
This is similar to `# line ...` directives in C.
---------------------------------------------------------------------------
by nikic at 2011/06/05 08:51:20 -0700
I don't quite yet understand it's use cases.
---------------------------------------------------------------------------
by arnaud-lb at 2011/06/05 09:17:57 -0700
The `{% line ... %}` directive is not meant to be used by humans, but rather by generators.
The use case is the same as [#line directives in C](http://gcc.gnu.org/onlinedocs/cpp/Line-Control.html): when you generate a C file from a template, you would prefer that the compiler refers to the line number of the template, instead of the line number of the generated file.
In my case, I built a [HAML compiler for php](https://github.com/arnaud-lb/MtHaml) which can target Twig as an output language. I use it as a Twig pre-processor so that it translates HAML scripts to Twig scripts on the fly in a custom Twig_Loader.
So I have scripts like that:
%p
test
%div = foo.bar
which is compiled like that:
<p>
test
</p>
<div>
{{ foo.bar }}
</div>
If an error occurs in the execution of {{ foo.bar }}, Twig will throw an error refering to line 5 in the original script, which is wrong. A simple solution to this is the {% line %} directive:
<p>
test
</p>
<div>
{% line 3 %}
{{ foo.bar }}
</div>
Now if an error occures in {{ foo.bar }}, the error will refer to line 3.
---------------------------------------------------------------------------
by nikic at 2011/06/05 09:33:26 -0700
Ah, okay, seems reasonable. Though I'm not sure whether it is appropriate to use the comment syntax to accomplish that.
---------------------------------------------------------------------------
by arnaud-lb at 2011/06/05 10:41:03 -0700
You are right, I changed the request to use the block syntax instead.
Fabien Potencier [Tue, 14 Jun 2011 06:19:32 +0000]
added null as an alias for the none test
nikic [Fri, 10 Jun 2011 14:50:20 +0000]
Refactor and add additional default filter tests
nikic [Thu, 9 Jun 2011 18:50:48 +0000]
Make `a.b is defined` not throw an exception if a is not defined (in strict mode)
Fabien Potencier [Tue, 7 Jun 2011 14:33:55 +0000]
added Twig_Loader_Filesystem::addPath()
Arnaud Le Blanc [Sun, 5 Jun 2011 17:38:12 +0000]
added {% line \d+ %} directive
Fabien Potencier [Sun, 5 Jun 2011 10:12:05 +0000]
added missing debug info when using traits
Fabien Potencier [Sun, 5 Jun 2011 10:07:30 +0000]
fixed Twig_Error when the exception is thrown from within the generated template
Henrik Bjørnskov [Wed, 1 Jun 2011 13:27:40 +0000]
Add testcase for issue #347
Fabien Potencier [Sat, 28 May 2011 15:35:04 +0000]
updated VERSION
Fabien Potencier [Sat, 28 May 2011 15:34:18 +0000]
releasing 1.1.0 RC1
Fabien Potencier [Sat, 28 May 2011 15:01:35 +0000]
updated CHANGELOG
Fabien Potencier [Sat, 28 May 2011 14:38:25 +0000]
Merge remote branch 'tna/default-filter'
* tna/default-filter:
Moved default filter fix to its proper place
Fixes default filter
Fabien Potencier [Sat, 28 May 2011 14:36:42 +0000]
fixed timezone when using the date filter with a UNIX timestamp (it now uses the default timezone instead of UTC to mimics the date() function behavior)
Jeremy Mikola [Fri, 27 May 2011 18:54:06 +0000]
Date filter should treat strict integers as Unix timestamps (same as all-digit strings)
Without a string cast, ctype_digit() will return false for an integer.
Tobias Naumann [Thu, 26 May 2011 15:00:59 +0000]
Moved default filter fix to its proper place
Tobias Naumann [Thu, 26 May 2011 09:14:15 +0000]
Fixes default filter
nikic [Tue, 24 May 2011 10:48:47 +0000]
Refactor GetAttr defined implementation to consider null defined
Brikou CARRE [Fri, 20 May 2011 12:25:21 +0000]
fixed constructor + cosmetic
Fabien Potencier [Wed, 18 May 2011 06:14:47 +0000]
tweaked docs
nikic [Tue, 3 May 2011 17:07:35 +0000]
Add some further is defined unit tests and give clearer names
nikic [Tue, 3 May 2011 16:56:57 +0000]
Fix regression in defined test for GetAttr. Fixes #319
Fabien Potencier [Wed, 18 May 2011 06:05:56 +0000]
Merge remote branch 'jpb0104/master'
* jpb0104/master:
Added an example of escaped "at" in a date filter.
Jason Bouffard [Tue, 17 May 2011 21:28:44 +0000]
Added an example of escaped "at" in a date filter.
Relates to https://github.com/fabpot/Twig/issues/330
Fabien Potencier [Tue, 10 May 2011 05:21:09 +0000]
simplified code
Fabien Potencier [Mon, 9 May 2011 15:47:21 +0000]
added a test for the raw tag
Fabien Potencier [Mon, 9 May 2011 15:47:09 +0000]
moved a test
Fabien Potencier [Mon, 9 May 2011 15:35:00 +0000]
fixed parsing problem when a large chunk of text is enclosed in a raw tag
This is a quick and ugly fix... This should be refactored later on
Fabien Potencier [Mon, 9 May 2011 14:31:32 +0000]
fixed CS
Fabien Potencier [Fri, 29 Apr 2011 15:18:51 +0000]
updated email address
Fabien Potencier [Fri, 29 Apr 2011 15:14:17 +0000]
updated CHANGELOG
Fabien Potencier [Fri, 29 Apr 2011 13:23:00 +0000]
made a small speed optimization when using auto-escaping
Fabien Potencier [Fri, 29 Apr 2011 10:45:10 +0000]
updated version
Joseph Bielawski [Fri, 29 Apr 2011 09:59:03 +0000]
Compiler.php - CS fix
Joseph Bielawski [Fri, 29 Apr 2011 09:57:54 +0000]
TokenParserBroker.php - CS fix
Joseph Bielawski [Fri, 29 Apr 2011 09:56:34 +0000]
Parser.php - CS fix
Joseph Bielawski [Fri, 29 Apr 2011 09:54:59 +0000]
Lexer.php - CS fix
Joseph Bielawski [Fri, 29 Apr 2011 09:46:23 +0000]
Environment.php - CS fix
Joseph Bielawski [Fri, 29 Apr 2011 09:42:36 +0000]
TokenParserBroker.php - CS fix