Commits
-------
6486e25 fixed used statements
3530858 fixed typehints in docblocks (IDE completion works now)
Discussion
----------
Typehint fix
---------------------------------------------------------------------------
by fabpot at 2012-04-10T09:12:51Z
For type hint in PHPDoc, we are using the class name and not the full namespace (of course, we need the associated use statement).
---------------------------------------------------------------------------
by brikou at 2012-04-10T09:29:39Z
@fabpot ok fabien, i've added the use statements and (for both entityRepository and manager) cheer
Commits
-------
a56bea6 removed `param_converter` from symfony-1.0.xsd
Discussion
----------
removed `param_converter` from symfony-1.0.xsd
I think its a relict of the SensioFrameworkExtraBundle?
Commits
-------
55014a6 [Routing] Request methods always return a raw path, fix the matcher to decode only once
d17ba0e Fixed base URL detection when request URI contains encoded chars
Discussion
----------
[RFC] Fix issues with url decoding
Related: #2324, #2963, #2962, #2579
### This PR fixes two issues:
* `+` in paths were turned to " " by `urldecode()`
* `urldecode()` was called a few times (and a different number of times according to which part of the path was handled, see #2962 for details).
### BC Breaks:
* `Request::getPathInfo()`, `Request::getBaseUrl()` and `Request::getBasePath` now return the raw (encoded) path (vs a decoded path before this PR). You should check any calls to these methods in your code and wrap them in `rawurldecode()` if needed.
* The `UrlMatcher` now decodes the URL only once (i.e. variable are no more decoded twice) and use `rawurldecode()` to support `+`.
### Notes:
* @arnaud-lb, the first commit is based on your #2963 so I put your name for the commit,
### Comment history from the original PR:
@vicb
**The state before this PR:**
* getRequestUri() returns an **encoded** value
* getPathInfo() returns a **decoded** value
* getBaseUrl() returns a **decoded** value
* getBasePath() returns a **decoded** value
The decoded value is wrong as `urldecode` is used in place of `rawurldecode` turning `+` into a space character (#2324).
The matcher starts by urldecoing the path (it is already decoded as explained right before) and then urldecodes each variable one more time.
We end up with a path being decoded twice and variables being decoded three times.
`Request::getUri()` calls both `getBaseUrl()` and `getPathInfo()` so that the return URI is **decoded**.
**The state after the PR:**
* getRequestUri() returns an **encoded** value
* getPathInfo() returns an **encoded** value
* getBaseUrl() returns an **encoded** value
* getBasePath() returns an **encoded** value
We are consistent and we have the raw values everywhere - there is no (easy) way to get the encoded value back once it has been decoded as it is done in the current code.
The matcher relies on an encoded value and decode the value only once (using `rawurldecode` to support `+`s).
So basically this PR:
* fix a bug - URL with `+` are now supported,
* makes paths consistent - encoded values everywhere, including `getUri()`
* makes variables consistent: they are decoded only once - the same as query string parameters.
There are some BC breaks:
* getPathInfo() returns an encoded value vs a decoded one before,
* getBaseUrl() returns an encoded value vs a decoded one before.
* getBasePath() returns an encoded value vs a decoded one before.
Any code relying on the output of one of the 2 previous methods should be checked and upgraded if needed. I am interested in the use cases where your code need to be updated.
@Seldaek
I checked a few projects and this is what I found (usage of getPathInfo & getBaseUrl):
- One use case of getPathInfo to check if the url started with `/something/` which is a prefix used for all "overlay" content which had to be treated differently somewhere => most likely unaffected
- One use case for checking path prefixes by regex in our [CorsBundle](https://github.com/nelmio/NelmioCorsBundle/blob/master/EventListener/CorsListener.php#L52-56) => potentially affected depending on the complexity of regexes I'd say
@vicb
Thanks @Seldaek for reporting the use cases. You second case would be solved by `rawurldecode`ing the path info which is a minimal change.
And in general I think we have to expand to doc to specify the url format that should be used.
---------------------------------------------------------------------------
by vicb at 2012-04-04T13:42:21Z
I'll squash the commits before this gets merged but for now it make the review easier.
Commits
-------
78d6f3f [Filesystem] Written missing tests.
1998f3f [Filesystem] Added silence operator to rename().
7ce5a52 [Filesystem] Fixed docs for rename().
3f2865b [Filesystem] rename() throws RuntimeException on error (fixes#3848).
Discussion
----------
[Filesystem] rename() throws RuntimeException on error.
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3848
---------------------------------------------------------------------------
by alessandro1997 at 2012-04-09T19:32:23Z
I have a doubt: I can't write any tests since the rename() function generates a warning if an error occurs. Should I use the silence operator or what else?
Maybe @stof could enlighten me?
Commits
-------
31dde14 [Locale] updated StubIntlDateFormatter::format() behavior for PHP >= 5.3.4
Discussion
----------
[Locale] updated StubIntlDateFormatter::format() behavior for PHP >= 5.3.4
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
[![Build Status](https://secure.travis-ci.org/eriksencosta/symfony.png?branch=locale)](http://travis-ci.org/eriksencosta/symfony)
---------------------------------------------------------------------------
by drak at 2012-04-08T23:20:20Z
This looks like a feature addition as opposed to a bug fix and if so, should probably go in the master branch rather than 2.0.
---------------------------------------------------------------------------
by stof at 2012-04-08T23:30:25Z
@drak it is a bug fix as the stub is meant to have the same behavior than the real intl
---------------------------------------------------------------------------
by drak at 2012-04-08T23:36:08Z
ok, thanks for the clarification, I wasnt sure.
---------------------------------------------------------------------------
by eriksencosta at 2012-04-08T23:44:22Z
@stof is right. I myself fixed it in master and then remembered that bug fixes should be made in 2.0.
Bug fix: no
Feature addition: yes
Backwards compatibility break: ?
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
This speeds up Travis CI builds to `~2 min` also makes vendor management
a lot easier.
Commits
-------
6dca141 [Process] Skip signal assertion on windows
4cd0fb4 [Process] Skip test that is still getting stuck on windows
e82a05d [Process] Close pipes before calling proc_close to avoid deadlocks as advised on the proc_close php.net documentation
f4227b5 [Process] Removing useless code (this is already done in updateStatus)
2d586d2 [Process] Fix a mistake triggering stream_select errors
Discussion
----------
Process fixes
A few fixes, including making the tests pass on windows and fixing composer/composer#543. Given the sensitivity of this code I did a bunch of very granular commits explaining everything.
Commits
-------
f3408cc [Finder] Avoid unnecessary use of the @ operator
Discussion
----------
[Finder] Avoid unnecessary use of the @ operator
Tests are passing
---------------------------------------------------------------------------
by stof at 2012-04-08T17:42:01Z
Does PHP really throw an exception on failure or is it only the case when an error handler converts a warning to an exception ? It would be weird given the small amount of cases where PHP uses exceptions.
---------------------------------------------------------------------------
by Seldaek at 2012-04-08T17:43:51Z
```
$ php -r 'new DateTime("foo");'
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (foo) at
position 0 (f): The timezone could not be found in the database' in Command line code on line 1
```
---------------------------------------------------------------------------
by Seldaek at 2012-04-08T17:45:09Z
In a constructor it's pretty hard to return false, so it has to throw an exception. The php.net docs also say it so I'm fairly sure it's nothing specific to my setup.
Commits
-------
292364a [DomCrawler] Added some docbocks into DomCrawler classes. Closes#3832
Discussion
----------
[DomCrawler] Added some docbocks into DomCrawler classes, reordered func...
...tions to follow Symfony 2 CS. Closes#3832
---------------------------------------------------------------------------
by fabpot at 2012-04-08T10:38:39Z
Can you revert the code move as it makes merges between 2.0 and master much more complex. Thanks.
---------------------------------------------------------------------------
by stloyd at 2012-04-08T11:36:53Z
Reverted and changed commit message.
@fabpot Should I make PR for `master` according to CS ?
---------------------------------------------------------------------------
by stof at 2012-04-08T11:40:58Z
@stloyd this can be considered as a bugfix as you are fixing the phpdoc. So 2.0 is fine
Commits
-------
8726ade Adds more features to twig:lint command
1d7e9d9 Adds a linter command for templates
Discussion
----------
Adds a linter command for templates
Let's this PR be stoffed. ;)
---------------------------------------------------------------------------
by Tobion at 2012-04-06T15:48:18Z
Checking a single file is very limited. Checking a whole directory would be more useful, wouldn't it?
---------------------------------------------------------------------------
by willdurand at 2012-04-06T17:56:57Z
I think you should provide a way to validate all templates for a given bundle, something like:
php app/console twig:lint @MySuperBundle
---------------------------------------------------------------------------
by henrikbjorn at 2012-04-06T18:03:45Z
Wouldnt it be better to throw some kind of exception if the lint is erroneous?
---------------------------------------------------------------------------
by marcw at 2012-04-07T11:22:34Z
@Tobion @willdurand You can do that by combining unix tools.
@henrikbjorn Why ?
---------------------------------------------------------------------------
by marcw at 2012-04-07T11:27:11Z
Updated.
---------------------------------------------------------------------------
by dlsniper at 2012-04-07T13:15:53Z
@marcw it would be indeed nice to have support for a bundle/directory out of the box as some of the Symfony2 users might not be running unix or know the right commands to make this work.
I could help you with a PR in your repo if you want.
---------------------------------------------------------------------------
by henrikbjorn at 2012-04-07T18:55:34Z
@marcw as the console component will catch them and convert them into the right error code, also will display what went wrong instead of just dieing.
---------------------------------------------------------------------------
by marcw at 2012-04-08T09:15:37Z
Updated with all comments and requested features.
Setting a property path like "article.tags" will now automatically try to
favor addTag() and removeTag() over setTags(), if found. If you want to
set up a property path with an irregular singular that is not detected,
you can use "|" to separate the plural from the singular form in the
path: "article.genera|genus".
Another consequence of this commit is that the MergeCollectionListener has
been simplified a lot. Forms returning an array or a collection will
always result in adders/removers being called now without having to add
this listener.
Commits
-------
fad114b Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags
Discussion
----------
Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: ![Build status](https://secure.travis-ci.org/ruimarinho/symfony.png?branch=exception_css_tweaks)
Fixes the following tickets: -
Todo: -
Ever been in a situation when you're debugging code wrapped around `<pre>` tags and that code throws an exception? If you're familiar with this screenshot, you have :-) ![Image](http://i.imgur.com/dwxdD.png)
This PR is just a little tweak to the exceptions layout CSS in order to allow your to view the exception message. It also fixes a word break when messages are too long. ![Image 2](http://i.imgur.com/whxZv.png).
The build is currently failing due to an unmerged patch from the 2.0 branch.
Commits
-------
fdee352 [TwigBridge] updated suggested packages
dad1750 [TwigBridge] updated TestCase as an abstract class
140ac20 [TwigBridge] fixed bootstrap
Discussion
----------
[TwigBridge] updated Composer suggested packages and test fixes
---------------------------------------------------------------------------
by eriksencosta at 2012-04-08T06:13:53Z
Rebased.
Commits
-------
22e2ad8 [Filesystem] Fixed relative path calculation for end path which is a subdirectory of the start path.
bc93787 [Filesystem] Fixed relative path calculation for paths with various combinations of trailing directory separators.
Discussion
----------
[Filesystem] Fixed relative path calculation
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Commits
-------
7f92833 [BrowserKit] Fixed cs.
df3da28 [BrowserKit] Using assertNull instead of assertEquals.
87890d3 [BrowserKit] Fixed CookieJar issue being unable to parse multiple cookies from Set-Cookie.
Discussion
----------
[BrowserKit] Fixed CookieJar being unable to parse multiple cookies
Fix proposition for #3109
My fix splits value of *Set-Cookie* header by comma. Than it checks each extracted part if it starts with a cookie-name (token). If check is positive cookie is added to the list. Otherwise it's appended to the previous value. First element is always added to the list.
[rfc6265](http://tools.ietf.org/html/rfc6265) defines cookie-name with token:
cookie-name = token
token = <token, defined in [RFC2616], Section 2.2>
token is defined in [rfc2616](http://tools.ietf.org/html/rfc2616#section-2.2) as follows:
token = 1*<any CHAR except CTLs or separators>
CHAR = <any US-ASCII character (octets 0 - 127)>
separators = "(" | ")" | "<" | ">" | "@"
| "," | ";" | ":" | "\" | <">
| "/" | "[" | "]" | "?" | "="
| "{" | "}" | SP | HT
That means cookie-name can be built out of following set of characters: *! # $ % & ' * + - . ^ _ ` | ~ 0-9 A-Z a-z*
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Commits
-------
e0ce6b4 [Form] Fixed required value guessed by ValidatorTypeGuesser
Discussion
----------
[Form] Fixed required value guessed by ValidatorTypeGuesser
Bug fix: yes
Feature addition: no
Backwards compatibility break: no*
Symfony2 tests pass: yes
Fixes the following tickets: #3661
Todo: -
![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3661)
The documentation states that a field is set to required if constrained with NotBlank or NotNull and to not required otherwise. Due to a bug this was not the case and fields were always required. This is now fixed.
The consequence is that some fields that were required before by default are not required anymore. The only difference is that the HTML5 "required" attribute disappears, because server-side validation did not occur before anyway.