web/konrad/twig.git
12 years agoadded notes in the doc about how the defined test and the default filter work
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

12 years agomerged branch nikic/allowIsDefinedOnMethods (PR #490)
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`?

12 years agomerged branch nikic/patch-1 (PR #489)
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.

12 years agoAllow defined test and default filter on methods
nikic [Sun, 30 Oct 2011 10:19:27 +0000]
Allow defined test and default filter on methods

12 years agoMake long var/block tests faster
nikic [Sun, 30 Oct 2011 10:03:56 +0000]
Make long var/block tests faster

12 years agofixed previous commit
Fabien Potencier [Sat, 29 Oct 2011 13:12:58 +0000]
fixed previous commit

12 years agorenamed none to null in doc
Fabien Potencier [Sat, 29 Oct 2011 12:56:00 +0000]
renamed none to null in doc

12 years agochanged the documentation to advertize null as begin the null value and none as an...
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

12 years agofixed in operator for empty strings
Fabien Potencier [Sat, 29 Oct 2011 12:50:10 +0000]
fixed in operator for empty strings

12 years agomerged branch nikic/updateExtensionDocs (PR #488)
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.

12 years agoUpdate extension docs and interface
nikic [Sat, 29 Oct 2011 12:05:14 +0000]
Update extension docs and interface

Twig isn't using globals for functions anymore.

12 years agofixed typo in doc
Fabien Potencier [Fri, 28 Oct 2011 15:23:01 +0000]
fixed typo in doc

12 years agomerged branch phmLabs/documentation_return (PR #483)
Fabien Potencier [Thu, 27 Oct 2011 19:47:32 +0000]
merged branch phmLabs/documentation_return (PR #483)

Commits
-------

389f2c2 Changed mode from 0755 to 0644
c48bd2f Fixed wrong used PHPDoc tags

Discussion
----------

Fixed wrong used PHPDoc tags

@param was used instead of @return

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

by fabpot at 2011/10/25 05:47:59 -0700

Can you revert the mode change (from 0644 to 0755)?

12 years agoadded more unit tests for defined and default
Fabien Potencier [Thu, 27 Oct 2011 16:30:53 +0000]
added more unit tests for defined and default

12 years agofixed the "defined" test and the "default" filter
Fabien Potencier [Thu, 27 Oct 2011 16:23:43 +0000]
fixed the "defined" test and the "default" filter

12 years agoadded more unit tests (some do not pass... yet)
Fabien Potencier [Wed, 26 Oct 2011 20:04:54 +0000]
added more unit tests (some do not pass... yet)

12 years agoadded missing supported charset for htmlspecialchars
Fabien Potencier [Wed, 26 Oct 2011 09:28:33 +0000]
added missing supported charset for htmlspecialchars

12 years agofixed deep nested defined tests
Fabien Potencier [Wed, 26 Oct 2011 07:33:02 +0000]
fixed deep nested defined tests

12 years agoremoved unneeded complexity in GetAttr node
Fabien Potencier [Wed, 26 Oct 2011 08:27:18 +0000]
removed unneeded complexity in GetAttr node

12 years agoadded a way to change Twig's options when running integration tests (updated tests...
Fabien Potencier [Wed, 26 Oct 2011 07:29:16 +0000]
added a way to change Twig's options when running integration tests (updated tests accordingly)

12 years agoRevert "fixed exception"
Fabien Potencier [Wed, 26 Oct 2011 06:05:11 +0000]
Revert "fixed exception"

This reverts commit df47659e9de71a48a24f31ed0cc16a2674a06d43.

12 years agofixed example in doc (closes #484)
Fabien Potencier [Tue, 25 Oct 2011 15:37:58 +0000]
fixed example in doc (closes #484)

12 years agoChanged mode from 0755 to 0644
Nils Langner [Tue, 25 Oct 2011 14:49:17 +0000]
Changed mode from 0755 to 0644

12 years agoadded some references to the doc
Fabien Potencier [Tue, 25 Oct 2011 14:33:42 +0000]
added some references to the doc

12 years agoFixed wrong used PHPDoc tags
Nils Langner [Tue, 25 Oct 2011 12:32:16 +0000]
Fixed wrong used PHPDoc tags

12 years agoreverted mode change from previous commit
Fabien Potencier [Tue, 25 Oct 2011 12:23:37 +0000]
reverted mode change from previous commit

12 years agomerged branch phmLabs/Twig_NodeInterface_Bug (PR #482)
Fabien Potencier [Tue, 25 Oct 2011 12:23:22 +0000]
merged branch phmLabs/Twig_NodeInterface_Bug (PR #482)

Commits
-------

c91357d Moved interfaces

Discussion
----------

Moved interfaces

The Countable and IteratorAggregate interfaces have to be part of the Twig_NodeInterface as the Twig_NodeInterface is used as a typehint and the function tries to iterate over its elements.

E.g:

Twig_NodeTraverser::traverseForVisitor

foreach ($node as $k => $n)

12 years agoRevert "added a tip for the block tag"
Fabien Potencier [Tue, 25 Oct 2011 12:14:55 +0000]
Revert "added a tip for the block tag"

This reverts commit 1a2175fc4992b74a473845eab0972d464086398f.

12 years agoMoved interfaces
Nils Langner [Tue, 25 Oct 2011 12:13:26 +0000]
Moved interfaces

12 years agoadded a tip for the block tag
Fabien Potencier [Tue, 25 Oct 2011 12:11:52 +0000]
added a tip for the block tag

12 years agomerged branch yegeniy/patch-1 (PR #474)
Fabien Potencier [Tue, 25 Oct 2011 12:01:54 +0000]
merged branch yegeniy/patch-1 (PR #474)

Commits
-------

cf03a65 add another example add another example to constant.rst

Discussion
----------

add another example

An example for using the `constant` function

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

by yegeniy at 2011/10/19 09:48:37 -0700

Should be ready.

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

by nikic at 2011/10/19 10:58:01 -0700

I think you should just add that as a line to the other example, so you got this in the end:

```rst
``constant``
============

``constant`` returns the constant value for a given string:

.. code-block:: jinja

    {{ some_date|date(constant('DATE_W3C')) }}
    {{ constant('Namespace\\Classname::CONSTANT_NAME') }}
```

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

by fabpot at 2011/10/21 07:24:32 -0700

That's indeed a good addition to the doc. Can you squash your commits in to one before I merge this pull request? Thanks.

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

by yegeniy at 2011/10/22 06:28:58 -0700

Thanks!

12 years agofixed typos
Fabien Potencier [Tue, 25 Oct 2011 11:59:24 +0000]
fixed typos

12 years agochanged the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNod...
Fabien Potencier [Tue, 25 Oct 2011 11:58:27 +0000]
changed the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNodeVisitor/addTokenParser/addExtension can now be called in any order)

12 years agoadd another example
Eugene Wolfson [Tue, 18 Oct 2011 22:47:02 +0000]
add another example
add another example to constant.rst

12 years agoadded Twig_Environment::display()
Fabien Potencier [Mon, 17 Oct 2011 11:01:40 +0000]
added Twig_Environment::display()

12 years agosimplified some code
Fabien Potencier [Mon, 17 Oct 2011 00:48:36 +0000]
simplified some code

12 years agoadded more unit tests
Fabien Potencier [Sun, 16 Oct 2011 23:16:34 +0000]
added more unit tests

12 years agoadded an optimization when the same temporary variable would have been created twice
Fabien Potencier [Sun, 16 Oct 2011 20:18:02 +0000]
added an optimization when the same temporary variable would have been created twice

12 years agofixed doc
Fabien Potencier [Sun, 16 Oct 2011 09:15:40 +0000]
fixed doc

12 years agomade the escape filter smarter when the encoding is not supported by PHP
Fabien Potencier [Sun, 16 Oct 2011 09:09:54 +0000]
made the escape filter smarter when the encoding is not supported by PHP

12 years agoadded a convert_encoding filter
Fabien Potencier [Sun, 16 Oct 2011 09:08:36 +0000]
added a convert_encoding filter

12 years agoadded a Twig_Node_Expression_DefaultFilter to replace the current way of dealing...
Fabien Potencier [Sun, 16 Oct 2011 03:46:09 +0000]
added a Twig_Node_Expression_DefaultFilter to replace the current way of dealing with default filters

12 years agoadded public getters on the environment to be able to get various stuff
Fabien Potencier [Sat, 15 Oct 2011 08:57:18 +0000]
added public getters on the environment to be able to get various stuff

12 years agofixed exception
Fabien Potencier [Fri, 14 Oct 2011 23:10:30 +0000]
fixed exception

12 years agofixed download page in the docs
Fabien Potencier [Fri, 14 Oct 2011 09:46:15 +0000]
fixed download page in the docs

12 years agomerged branch trompette/patch-1 (PR #465)
Fabien Potencier [Thu, 13 Oct 2011 06:20:40 +0000]
merged branch trompette/patch-1 (PR #465)

Commits
-------

0451cfd typo

Discussion
----------

typo

12 years agotypo
Benoît Merlet [Wed, 12 Oct 2011 12:45:28 +0000]
typo

12 years agoupdated CHANGELOG
Fabien Potencier [Sat, 8 Oct 2011 12:30:37 +0000]
updated CHANGELOG

12 years agorefactored Twig_Node_Expression_GetAttr for better readability of compiled templates
Fabien Potencier [Thu, 6 Oct 2011 17:22:19 +0000]
refactored Twig_Node_Expression_GetAttr for better readability of compiled templates

12 years agooptimized variable access when possible
Fabien Potencier [Fri, 30 Sep 2011 15:04:06 +0000]
optimized variable access when possible

12 years agorefactored 'defined' test and 'default' filter
Fabien Potencier [Thu, 6 Oct 2011 14:37:14 +0000]
refactored 'defined' test and 'default' filter

Node manipulations have been moved outside the compile() method.
That's needed if we want to be able to visit all nodes that will be
compiled.

12 years agooptimized lexer by pre-computing regexes
Fabien Potencier [Thu, 6 Oct 2011 13:01:29 +0000]
optimized lexer by pre-computing regexes

12 years agomade an optimization by removing array_merge usage
Fabien Potencier [Thu, 6 Oct 2011 11:13:28 +0000]
made an optimization by removing array_merge usage

12 years agobumped version to 1.4.0-DEV
Fabien Potencier [Sat, 8 Oct 2011 12:05:18 +0000]
bumped version to 1.4.0-DEV

12 years agoprepared the 1.3.0-RC1 release
Fabien Potencier [Sat, 8 Oct 2011 12:04:10 +0000]
prepared the 1.3.0-RC1 release

12 years agoupdated CHANGELOG
Fabien Potencier [Sat, 8 Oct 2011 12:03:38 +0000]
updated CHANGELOG

12 years agoprepared the 1.3.0-RC1 release
Fabien Potencier [Tue, 4 Oct 2011 07:58:29 +0000]
prepared the 1.3.0-RC1 release

12 years agofixed a unit test for PHPUnit 3.6
Fabien Potencier [Mon, 3 Oct 2011 21:08:58 +0000]
fixed a unit test for PHPUnit 3.6

12 years agofixed optimizer
Fabien Potencier [Fri, 30 Sep 2011 20:49:47 +0000]
fixed optimizer

12 years agofixed wrong node type for the for tag
Fabien Potencier [Fri, 30 Sep 2011 14:40:46 +0000]
fixed wrong node type for the for tag

12 years agoadded an optimization for simple variables output
Fabien Potencier [Fri, 30 Sep 2011 12:54:26 +0000]
added an optimization for simple variables output

12 years agofixed hardcoded name escaping
Fabien Potencier [Fri, 30 Sep 2011 12:51:05 +0000]
fixed hardcoded name escaping

12 years agoremoved usage of PHP 5.3 __DIR__
Fabien Potencier [Thu, 29 Sep 2011 15:16:55 +0000]
removed usage of PHP 5.3 __DIR__

12 years agofixed composer version
Fabien Potencier [Thu, 29 Sep 2011 14:51:02 +0000]
fixed composer version

12 years agomerged branch igorw/composer (PR #452)
Fabien Potencier [Thu, 29 Sep 2011 14:47:57 +0000]
merged branch igorw/composer (PR #452)

Commits
-------

bd04de2 [composer] add composer.json

Discussion
----------

[composer] add composer.json

12 years agomerged branch phiamo/master (PR #454)
Fabien Potencier [Thu, 29 Sep 2011 14:46:39 +0000]
merged branch phiamo/master (PR #454)

Commits
-------

5fa0094 Added Capability to format DateInterval via twig date filter

Discussion
----------

Added Capability to format DateInterval via twig date filter

hi,
i was wondering why twig couldn't format my DateInterval and added it.

Either this is ok for you or we should add something similar for DateInterval because it uses a little bit different syntax to format its string (e.g. prepend with "%")

Cheers Phil

12 years agofixed unit test broken by previous merge
Fabien Potencier [Thu, 29 Sep 2011 14:44:28 +0000]
fixed unit test broken by previous merge

12 years agomerged branch Sannis/patch-1 (PR #455)
Fabien Potencier [Thu, 29 Sep 2011 14:39:01 +0000]
merged branch Sannis/patch-1 (PR #455)

Commits
-------

68ec644 FloorDiv (//) should return integer value according to documentation

Discussion
----------

FloorDiv (//) should return integer value according to documentation

12 years agoFloorDiv (//) should return integer value according to documentation
Oleg Efimov [Thu, 29 Sep 2011 09:24:03 +0000]
FloorDiv (//) should return integer value according to documentation

12 years agoAdded Capability to format DateInterval via twig date filter
phiamo [Thu, 29 Sep 2011 00:44:55 +0000]
Added Capability to format DateInterval via twig date filter

12 years ago[composer] add composer.json
Igor Wiedler [Tue, 27 Sep 2011 18:15:15 +0000]
[composer] add composer.json

12 years agoadded an optimization for the parent() function
Fabien Potencier [Tue, 27 Sep 2011 12:17:34 +0000]
added an optimization for the parent() function

12 years agoadded a note about the usage of Twig_Template methods
Fabien Potencier [Tue, 27 Sep 2011 12:05:30 +0000]
added a note about the usage of Twig_Template methods

12 years agorefactored documentation
Fabien Potencier [Mon, 26 Sep 2011 21:40:44 +0000]
refactored documentation

12 years agosimplified intro and added a not about the render() method in docs
Fabien Potencier [Mon, 26 Sep 2011 09:19:36 +0000]
simplified intro and added a not about the render() method in docs

12 years agofixed makup in doc
Fabien Potencier [Mon, 26 Sep 2011 08:32:52 +0000]
fixed makup in doc

13 years agomade a small optimization when a macro does not take any argument
Fabien Potencier [Sat, 24 Sep 2011 12:20:57 +0000]
made a small optimization when a macro does not take any argument

13 years agoadded cache reloading when auto_reload is true and an extension has been modified
Fabien Potencier [Sat, 24 Sep 2011 06:05:14 +0000]
added cache reloading when auto_reload is true and an extension has been modified

13 years agotweaked docs
Fabien Potencier [Fri, 23 Sep 2011 05:36:42 +0000]
tweaked docs

13 years agotweaked previous merge
Fabien Potencier [Thu, 22 Sep 2011 20:08:10 +0000]
tweaked previous merge

13 years agomerged branch runfalk/master (PR #368)
Fabien Potencier [Thu, 22 Sep 2011 20:04:27 +0000]
merged branch runfalk/master (PR #368)

Commits
-------

eb5c9fb Recipe code formatting fix. New recipe for improved APC bytecode support

Discussion
----------

APC recipe

A new recipe to support cache invalidation when using *APC* with *apc.stat* = 0 and compiled code caching turned on. One sometimes want to test things without restarting apache. This recipe overrides *writeCacheFile* in *Twig_Environment* and calls *apc_compile_file to refresh cache.

13 years agoadded the possibility to force the escaping of a string already marked as safe
Fabien Potencier [Thu, 22 Sep 2011 19:57:09 +0000]
added the possibility to force the escaping of a string already marked as safe

13 years agoadded traits support for the parent function
Fabien Potencier [Thu, 22 Sep 2011 10:03:40 +0000]
added traits support for the parent function

13 years agoallowed empty templates to be used as traits
Fabien Potencier [Thu, 22 Sep 2011 09:51:27 +0000]
allowed empty templates to be used as traits

13 years agobumped version to 1.3.0-DEV
Fabien Potencier [Thu, 22 Sep 2011 09:30:08 +0000]
bumped version to 1.3.0-DEV

13 years agoprepared 1.2.0 release
Fabien Potencier [Tue, 13 Sep 2011 15:01:30 +0000]
prepared 1.2.0 release

13 years agoprepared 1.2.0-RC1 release
Fabien Potencier [Sat, 10 Sep 2011 06:57:30 +0000]
prepared 1.2.0-RC1 release

13 years agoadded an exception for unclosed tags
Fabien Potencier [Tue, 6 Sep 2011 11:42:02 +0000]
added an exception for unclosed tags

13 years agoupdated CHANGELOG
Fabien Potencier [Tue, 6 Sep 2011 07:15:46 +0000]
updated CHANGELOG

13 years agomerged branch maxromanovsky/master (PR #431)
Fabien Potencier [Tue, 6 Sep 2011 07:14:27 +0000]
merged branch maxromanovsky/master (PR #431)

Commits
-------

4b95621 Added: Countable interface support for empty test

Discussion
----------

Countable interface support for empty test

See [issue](https://github.com/fabpot/Twig/issues/430)

13 years agoAdded: Countable interface support for empty test
Max Romanovsky [Sun, 4 Sep 2011 12:13:42 +0000]
Added: Countable interface support for empty test

13 years agoadded more unit tests
Fabien Potencier [Thu, 1 Sep 2011 08:50:13 +0000]
added more unit tests

13 years agoremoved some loop variable when using an if statement in a for loop
Fabien Potencier [Thu, 1 Sep 2011 08:40:40 +0000]
removed some loop variable when using an if statement in a for loop

13 years agomade a markup refactoring
Fabien Potencier [Thu, 1 Sep 2011 07:16:08 +0000]
made a markup refactoring

13 years agofixed algorithm that determines if a template using inheritance is valid (no output...
Fabien Potencier [Thu, 1 Sep 2011 06:08:16 +0000]
fixed algorithm that determines if a template using inheritance is valid (no output between block definitions)

13 years agotweaked an error message
Fabien Potencier [Thu, 1 Sep 2011 06:06:05 +0000]
tweaked an error message

13 years agorenamed a class in unit test to avoid confusion with PHPStorm
Fabien Potencier [Wed, 31 Aug 2011 09:10:12 +0000]
renamed a class in unit test to avoid confusion with PHPStorm

13 years agofixed resolveTemplate() method (we only catch loader exceptions)
Fabien Potencier [Tue, 30 Aug 2011 20:58:17 +0000]
fixed resolveTemplate() method (we only catch loader exceptions)

13 years agoadded better support for encoding problems when escaping a string (available as of...
Fabien Potencier [Tue, 30 Aug 2011 05:35:55 +0000]
added better support for encoding problems when escaping a string (available as of PHP 5.4)

From the PHP CHANGELOG:

The flag ENT_SUBSTITUTE makes invalid multibyte sequences be replaced by
U+FFFD (UTF-8) or &#FFFD; by htmlspecialchars and htmlentities. It is an
alternative to the default behavior, which just returns an empty string and to
ENT_IGNORE, which is a security risk. The behavior follows the recommendations
of Unicode Technical Report #36.

13 years agosimplified previous merge
Fabien Potencier [Mon, 29 Aug 2011 16:47:24 +0000]
simplified previous merge