[HttpFoundation] Added BinaryFileResponse.
[OptionsResolver] fix removing normalizers
[OptionsResolver] fix normalizer without corresponding option
Add check to Store::unlock to ensure file exists

Fix indentation and shorten code
[Console] fixed progress bar jumping
[Routing] fixed possible parameters conflict in apache url matcher
Use Norm Data instead of Data

This listener is triggered when normalized data are binded.

We have to use $event->getForm()->getNormData() instead of $event->getForm()->getData().
merged branch jonathaningram/issue_5375 (PR #5376)

This PR was merged into the 2.0 branch.

Commits
-------

a094f7e Add check to Store::unlock to ensure file exists

Discussion
----------

[2.0] [HttpKernel] Add check to Store::unlock to ensure file exists

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes

I was seeing this error in my logs when using an `AppCache`:

```
Error 2: /var/www/beta.example.com/shared/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/Store.php line 92: unlink(/var/www/beta.example.com/releases/20120827020525/app/cache/beta/http_cache/md/c2/88/66a911b5266a57bdd55131a47895b8861dfd.lck): No such file or directory
```

It was only occurring when the `http_cache` file was being primed (i.e. first load).

I've added a simple check to ensure that the file is a valid file before trying to unlink. I also added a missing `@return` docblock. Note: I've chosen to return `false` if the file does not exist as this seems to be the behaviour of the `purge` method.

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

by jonathaningram at 2012-08-29T06:46:52Z

@henrikbjorn done and rebased. Thanks.

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

by jonathaningram at 2012-09-17T22:38:47Z

@henrikbjorn any news on this one? It's currently not possible to use the HTTP Cache without the first request failing.

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

by jonathaningram at 2012-09-25T01:28:38Z

ping @fabpot sorry to keep pushing this, but any chance you could take a look at this?
[HttpFoundation] Fix name sanitization after perfoming move
merged branch helios-ag/patch (PR #5496)

This PR was squashed before being merged into the 2.0 branch (closes #5496).

Commits
-------

9872d26 [HttpFoundation] Fix name sanitization after perfoming move

Discussion
----------

[HttpFoundation] Fix name sanitization after perfoming move

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2577
License of the code: MIT

Further work on #2577, fixes name sanitization, after moving file name with new name with non latin characters in the beginning.

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

by stloyd at 2012-09-12T09:52:05Z

You must revert chmod changes.

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

by helios-ag at 2012-09-12T14:30:36Z

@stloyd fixed

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

by stof at 2012-10-13T21:12:43Z

@fabpot what is the status of this PR ?
The exception message should say which field is not mapped
Fixed typos
[Finder] Added filename containing space to tests.
[Finder] Fixed filename containing space bug in gnu adapter.
merged branch pborreli/sun-typos (PR #5858)

This PR was merged into the master branch.

Commits
-------

a7ce6be Fixed typos

Discussion
----------

Fixed typos
merged branch mvrhov/patch-2 (PR #5857)

This PR was merged into the 2.0 branch.

Commits
-------

6b42c8c The exception message should say which field is not mapped

Discussion
----------

The exception message should tell which field is not mapped
merged branch jfsimon/issue-5851 (PR #5859)

This PR was merged into the master branch.

Commits
-------

2817a47 [Finder] Fixed filename containing space bug in gnu adapter.
9bf7cb0 [Finder] Added filename containing space to tests.

Discussion
----------

[Finder] Fixed filename containing space bug in gnu find adapter.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes: #5851

`GNU find` adapter now uses `cut` instead of `awk`.
merged branch niklasf/binary-file-response (PR #4546)

This PR was merged into the master branch.

Commits
-------

2f7bbbf [HttpFoundation] Added BinaryFileResponse.

Discussion
----------

[2.2] [HttpFoundation] Added BinaryFileResponse.

Another stab at #3602, based on @stealth35's code at https://gist.github.com/1472230.

- Move things around a little, clean things up, looking how it has been done in StreamedResponse.
- Add tests.
- Make functions chainable.
- Add a flag whether or not to trust the X-Sendfile-Type header.

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

by Partugal at 2012-06-10T19:56:43Z

What about support X-Accel-Redirect (nginx)?

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

by niklasf at 2012-06-10T20:41:10Z

@Partugal: So we support X-Sendfile-Type to pick the X-Sendfile header. What else would be needed to support X-Accel-Redirect (which we should definitely do)?

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

by Partugal at 2012-06-10T21:29:41Z

@niklasf Because nginx not use full file path, this need X-Accel-Mapping header (http://rack.rubyforge.org/doc/Rack/Sendfile.html)

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

by niklasf at 2012-06-10T22:45:38Z

@Partugal: Alright. Doing such a substitution now. Also added a test for that.

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

by stealth35 at 2012-06-11T07:47:35Z

I think the MIME should be base on the extensions map, for an example with `xlsx` that send an `application/zip` or a `xlsx` file MIME is `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`

Client to server : Reverve MIME => libmagic
Server to client : MIME => MIME map

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

by niklasf at 2012-06-11T14:40:00Z

@partugal: Thanks! Also added tests. Any e-mail you want to have in your credits?

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

by niklasf at 2012-06-11T14:41:39Z

@stealth35: Yeah ... makes sense. How would I get that information?

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

by stealth35 at 2012-06-11T14:47:36Z

use the `Symfony\Component\HttpFoundation\File\Mimetype\MimeTypeExtensionGuesser` it's the same map as Apache
and if the extension don't exists use `$this->getMimeType` and finaly `application/octet-stream`

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

by Partugal at 2012-06-11T15:46:41Z

@niklasf Thanks you for your work
If needed you may use linniksa@gmail.com

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

by niklasf at 2012-06-14T10:58:19Z

@stealth35: Sorry. I have to ask again.
 - So the first step would be using the map in `MimeTypeExtensionGuesser`? I don't see how I can access that, because the `guess()` method it has, is for guessing extensions from mime types, not the reverse.
 - Then, by `$this->getMimeType` you mean the getMimeType() method of the file? Sounds good.
 - `application/octet-stream` as the fallback. Alright.

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

by stealth35 at 2012-06-14T11:00:33Z

Yeah sorry `MimeTypeExtensionGuesser` is for getting an extension with the Mime, forget about this, i'll take care aboute all MIME intégration later

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

by niklasf at 2012-06-14T13:12:22Z

@stealth35: Awesome. Thanks a lot.

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

by jalliot at 2012-08-07T20:53:54Z

@niklasf You should backport the changes from 532334d23dd196a42df48da1ff439549b608cfc1 and 3f51bc0a3d391bddc2bdb06f16b3125ad6ceafae

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

by niklasf at 2012-08-07T21:07:10Z

@jalliot Thanks. Fixed.
merged branch jakzal/yamlDoubleQuotesDumperFix (PR #4320)

Commits
-------

b631073 [Yaml] Fixed double quotes escaping in Dumper.

Discussion
----------

[Yaml] Fixed double quotes escaping in Dumper

Issue #4308 is caused by Dumper::escapeWithDoubleQuotes() which uses [str_replace()](http://php.net/str_replace).

From the php docs:

> Because str_replace() replaces left to right, it might replace a previously inserted value when doing multiple replacements.

We should be very careful in deciding about the order of elements in $escapees array. I'd really appreciate if someone reviewed my fix. Tests say I didn't break anything but I'm not sure what percentage of Yaml specification is covered by tests.

Bug fix: yes
Feature addition: no
Backwards compatibility break: not that I know
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/jakzal/symfony.png?branch=yamlDoubleQuotesDumperFix)](http://travis-ci.org/jakzal/symfony)
Fixes the following tickets: #4308

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

by travisbot at 2012-05-18T08:53:51Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1364279) (merged 5192722c into a04acc89).

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

by travisbot at 2012-05-18T23:19:49Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1371539) (merged ecaa1aab into fc3c609b).

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

by dinamic at 2012-05-19T07:35:21Z

Something is really wrong with this method. You can see clearly that multiple characters would fail proper escaping.

Here's an example:
```
$value = '\\\\"some value\n \"some quoted string\" and \'some single quotes one\'"';
var_dump(Escaper::escapeWithDoubleQuotes($value));
string(72) ""\\\"some value\n \\some quoted string\\ and 'some single quotes one'\"""
```

To begin with the backslash - in the initial value you have 2 (escaped ones), that after escaping should result in 4, not in 1 (escaped). I guess this behavior has to be verified with the importer, but imho it does not seem right.

Does anyone know why this escaping wasn't done using a regular expression in first place?

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

by clemens-tolboom at 2012-05-19T10:18:58Z

Searching for https://duckduckgo.com/?q=what+is+\xc2\x85 the table on http://stackoverflow.com/questions/6609895/efficiently-replace-bad-characters is interesting enough to decide we need way more documentation on this file.

\xc2\x85 seems to be triple dot (ellipses)
\xe2\x80\xa9 seems to be paragraph separator see http://drupal.org/node/914360#comment-3468550

Conflicts:
	src/Symfony/Component/Yaml/Escaper.php
[HttpKernel] added some more HTTP exceptions