symfony/symfony — pull request #7415 by romainneutron (2013-03-18 22:09:47+00:00)
Title: [2.3][HttpFoundation] Allow MimeTypeGuesser to be constructed and customized outside of the singleton scope

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #5615
| License | MIT

Allow singleton customization with the method `defineAsInstance`.

For example, to use a unique `CustomMimeTypeGuesser` :

```php
$guesser = new MimeTypeGuesser();
$guesser->register(new CustomMimeTypeGuesser());
$guesser->defineAsInstance();
```

the following call to `MimeTypeGuesser::getInstance();` will return the previously defined `$guesser`.