symfony/symfony — pull request #7026 by romainneutron (2013-02-08 15:17:41+00:00)
Title: [HttpFoundation][2.1] 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`.