Commit Graph

1382 Commits

Author SHA1 Message Date
martinml 3eecc609f4 Silence chmod() warnings (operation not permitted) when using CIFS mounts and possibly other cases. 2012-04-20 21:01:06 +03:00
Fabien Potencier 944a014636 renamed preserve_safety to preserves_safety to be consisten with needs_context and needs_environment 2012-04-20 19:04:30 +02:00
Fabien Potencier 43245cbd34 merged branch stof/preserve_safe (PR #684)
Commits
-------

0cbf5a0 Added an option to mark filters as preserving the safeness

Discussion
----------

Added an option to mark filters as preserving the safeness

Closes #678

I haven't written a test for this yet as I don't know how to provide a stub filter (as none of the core filters use this option) for the setup of the testsuite.

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

by fabpot at 2012-04-07T20:15:36Z

@stof: Can you also add some information in the phpdoc with an example so that people understand more easily when and why you would want to use this new option? Thanks.

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

by fabpot at 2012-04-07T20:16:36Z

Also, adding a unit test that demonstrates the bug you had in #678 would be good.

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

by stof at 2012-04-20T08:33:58Z

@fabpot none of the core filters are using this options, so what is the right way to add a test ?

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

by fabpot at 2012-04-20T08:36:26Z

by defining a filter in the test that uses it.

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

by stof at 2012-04-20T08:39:06Z

but is it possible to register a filter from the tests with the custom stuff used by Twig ?

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

by fabpot at 2012-04-20T08:48:06Z

in integrationTest.php, we already have quite a few functions and filters registered. I would just be a matter of adding a new one.

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

by stof at 2012-04-20T16:17:01Z

@fabpot renamed, tested and squashed
2012-04-20 19:02:27 +02:00
Christophe Coevoet 0cbf5a004c Added an option to mark filters as preserving the safeness
Closes #678
2012-04-20 16:23:51 +02:00
Fabien Potencier 0add6e2377 added an error when defining two blocks with the same name in a template (closes #701) 2012-04-20 11:17:22 +02:00
Fabien Potencier 6cf147dc99 added some missing tests for nested blocks 2012-04-20 10:56:03 +02:00
Fabien Potencier 037f86aa55 added a note in the documentation about what the C exension does 2012-04-18 07:19:25 +02:00
Fabien Potencier 5799a889c0 added missing parameters to Twig_Error_Syntax 2012-04-16 09:04:57 +02:00
Fabien Potencier 4e28408ce1 fixed a PHP notice when trying to access a key on a non-object/array variable 2012-04-12 14:36:25 +02:00
Fabien Potencier 58fbe0da41 updated CHANGELOG 2012-04-11 16:52:26 +02:00
Fabien Potencier fd634d1af2 merged branch Tobion/random-fix (PR #693)
Commits
-------

06361ca added note in changelog
2706412 fixed random function when charset is null

Discussion
----------

Fixed random function when charset is null

Fixed random function when charset is null and the value is an empty string, resulting in an mt_rand error max(-1) is smaller than min(0).
Also fixed a test on windows.

But I don't know why you introduced the special handling for `null === $env->getCharset()`.
Why is that necessary and why is it possible to have a null charset at all? Usually it defaults to utf-8 anyway.
2012-04-09 18:27:10 +02:00
Tobias Schultze 06361ca346 added note in changelog 2012-04-09 09:30:01 +02:00
Tobias Schultze 27064127ad fixed random function when charset is null 2012-04-09 09:26:53 +02:00
Fabien Potencier 46ae99fa4c merged branch igorw/composer (PR #691)
Commits
-------

72d3c19 [composer] Add branch alias for dev-master, adjust some other things

Discussion
----------

[composer] Add branch alias for dev-master, adjust some other things

* branch alias allows installation of dev-master by requiring 1.7.*, which is important since most packages depend on twig "<2.0.0"
* remove the version field, the version is determined by branch names and tags only
* change license to BSD-3, this is more explicit and the preferred format for BSD licenses
2012-04-08 14:20:37 +02:00
Fabien Potencier 1b47b40104 enhanced error reporting when the template file is an instance of SplFileInfo 2012-04-08 14:12:00 +02:00
Igor Wiedler 72d3c19e71 [composer] Add branch alias for dev-master, adjust some other things
* branch alias allows installation of dev-master by requiring 1.7.*, which is important since most packages depend on twig "<2.0.0"
* remove the version field, the version is determined by branch names and tags only
* change license to BSD-3, this is more explicit and the preferred format for BSD licenses
2012-04-08 14:07:23 +02:00
Fabien Potencier fe3c17f51f added a tip in the doc 2012-04-08 12:58:26 +02:00
Fabien Potencier c6bf195e21 added a unit test to demonstrate the need to pass blocks when calling renderBlock|displayBlock 2012-04-07 22:40:59 +02:00
Fabien Potencier a39784432a merged branch igorw/patch-1 (PR #689)
Commits
-------

11d4c6a [doc] Remove backticks in intro doc

Discussion
----------

[doc] Remove backticks in intro doc
2012-04-07 18:15:20 +02:00
Igor Wiedler 11d4c6af6a [doc] Remove backticks in intro doc 2012-04-07 18:38:17 +03:00
Fabien Potencier 7bc8ca5be7 merged branch markstory/loop-docs (PR #688)
Commits
-------

2a7102d Update docs concerning loop.last.

Discussion
----------

Update docs concerning loop.last.

Add docs for #687. `loop.last` is not defined when looping with conditions.
2012-04-07 16:41:37 +02:00
mark_story 2a7102d059 Update docs concerning loop.last. 2012-04-07 09:50:44 -04:00
Fabien Potencier fbacbe60ad added some more information about unknown variable/attributes in the doc (closes #685) 2012-04-05 22:53:39 +02:00
Fabien Potencier f2f1f32b41 added Twig_Environment::mergeGlobals() 2012-04-03 19:13:43 +02:00
Fabien Potencier 3398b38cf0 fixed a regression when a template only extends another one without defining any blocks (closes #683) 2012-04-03 19:13:30 +02:00
Fabien Potencier e2220bb282 bumped version to 1.7.0-DEV 2012-04-03 09:56:57 +02:00
Fabien Potencier 8f242ca858 made usage of mergeContextWithGlobals in macros 2012-04-03 09:45:11 +02:00
Fabien Potencier b19ef8ea16 fixed doc markup 2012-04-03 09:10:53 +02:00
Fabien Potencier 81807ea95b fixed doc markup 2012-04-03 09:08:32 +02:00
Fabien Potencier 53e89ef2eb fixed doc indexes 2012-04-03 09:07:53 +02:00
Fabien Potencier e9c1433a99 renamed a test 2012-04-03 09:07:04 +02:00
Fabien Potencier 1f6e640d96 added compilation checks to avoid misuses of the sandbox tag 2012-04-03 09:03:41 +02:00
Fabien Potencier 2055f567f9 fixed Twig unit tests when a template must throw an exception 2012-04-03 08:59:31 +02:00
Fabien Potencier 3f962ba89e enhance error reporting in Twig unit tests 2012-04-03 08:49:35 +02:00
Fabien Potencier 8656bd2afe added doc for the sandbox tag 2012-04-03 08:38:32 +02:00
Fabien Potencier 7ea15600ee added a note about sandbox policy checks in the doc (refs #677) 2012-04-03 07:32:06 +02:00
Fabien Potencier 999e54efb0 fixed filesystem loader freshness logic for high traffic websites (closes #682) 2012-04-03 07:20:26 +02:00
Fabien Potencier 50421c8620 bumped version to 1.6.4-DEV 2012-04-02 19:45:40 +02:00
Fabien Potencier ff61094aa3 prepared the 1.6.4 release v1.6.4 2012-04-02 19:42:18 +02:00
Fabien Potencier aa4efe1c0a updated CHANGELOG 2012-04-01 10:25:37 +02:00
Fabien Potencier 9473315752 fixed file permission 2012-04-01 10:24:05 +02:00
Fabien Potencier e3b5998a6d merged branch Nami-Doc/patch-1 (PR #680)
Commits
-------

27ffef0 The question I'm asking myself now is : how could I get $trace['line'] is not set if there's a check before the <= ? anyway, fixed
36618fe fix a bug where when an error would be thrown through the loader (Twig_Error_Loader by Twig_Loader_Filesystem, ie) the $trace['line'] would not be set (since we're not in a template)

Discussion
----------

fix a bug where when an error would be thrown through the loader

(Twig_Error_Loader by Twig_Loader_Filesystem, ie) the $trace['line'] would not be set (since we're not in a template)

thanks

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

by Nami-Doc at 2012-03-31T20:00:31Z

fixed, thanks @stof. Now I wonder (as I just wrote) : how could I get the error with that isset here ?

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

by stof at 2012-03-31T20:05:45Z

@Nami-Doc what was the exact error you got ?

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

by Nami-Doc at 2012-03-31T20:09:51Z

Php states that $trace['line'] isn't set

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

by Nami-Doc at 2012-03-31T20:23:33Z

O.K., got it. this has been fixed in #675, but composer (great tool) installed me last tag, but I think it's better to check it outside the loop anyway (micro-micro-optimisation)
2012-04-01 10:22:57 +02:00
Fabien Potencier 27f55cc567 fixed performance when compiling large files 2012-04-01 10:06:09 +02:00
Nami-Doc 27ffef077a The question I'm asking myself now is : how could I get $trace['line'] is not set if there's a check before the <= ? anyway, fixed 2012-03-31 22:59:45 +03:00
Nami-Doc 36618fe101 fix a bug where when an error would be thrown through the loader (Twig_Error_Loader by Twig_Loader_Filesystem, ie) the $trace['line'] would not be set (since we're not in a template) 2012-03-31 19:45:34 +03:00
Fabien Potencier dfb523eab6 made a small optimization when there is only one trait used in a template 2012-03-31 15:26:42 +02:00
Fabien Potencier 1e9a1ae0be optimized parent template creation when the template does not use dynamic inheritance 2012-03-31 15:21:57 +02:00
Fabien Potencier 6e2fd68e7b merged branch lyrixx/error-guess (PR #675)
Commits
-------

d0ae029 Fixed notice in Twig_Error::guessTemplateLine

Discussion
----------

Fixed notice in Twig_Error::guessTemplateLine

Sometimes, `trace['line']` is not available and makes notice.

You can see tests in https://github.com/lyrixx/Silex-Kitchen-Edition/tree/composer.
2012-03-24 00:23:13 +01:00
Grégoire Pineau d0ae0294c0 Fixed notice in Twig_Error::guessTemplateLine 2012-03-23 23:59:21 +01:00
Fabien Potencier a980023df8 merged branch carbonatethis/Documentation (PR #674)
Commits
-------

bf0cc53 Added code snippet to documentation to describe handling null values with date filter

Discussion
----------

Date filter docs update

Added code snippet to documentation to describe handling null values with date filter
2012-03-22 19:43:11 +01:00