-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mime] Add the component #29896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mime] Add the component #29896
Conversation
e8bf819
to
67da538
Compare
ac0eda7
to
7f7f4b8
Compare
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddMimeTypeGuesserPass.php
Show resolved
Hide resolved
src/Symfony/Component/Mime/Tests/AbstractMimeTypeGuesserTest.php
Outdated
Show resolved
Hide resolved
fd1a1dd
to
9bffccd
Compare
It'd be good to add a test for SVG: #15460 (comment) |
9bffccd
to
e6b4189
Compare
Last question from me: should we provide autoconfiguration for the new |
Autoconfig is already there, so if you create a class with this interface, it will be tagged automatically and registered. |
e6b4189
to
2b1e6cc
Compare
@teohhanhui The underlying guessers are the same as before, so that won't fix the mentioned issue. |
* @see Resources/bin/update_mime_types.php | ||
*/ | ||
private static $map = [ | ||
'application/acrobat' => ['pdf'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this kind of list scale? Even currently browser has trouble opening this file in github. It's almost 2000 entries now. Implementation of updating it could also be simpler if it was in external file and just var_export used. This point was raised by somebody in Slack originally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scale in what sense? Displaying it on Github is not a goal. PHP manages it fairly well and is even able to optimize it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goal should be scale it for both PHP and human reviewing the core functionality of MimeTypes.php. Currently this list is mostly just noise for human since it's something generated. Thanks to Opcache it should be fairly good optimized with external file as well, shouldn't it?
src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddMimeTypeGuesserPass.php
Show resolved
Hide resolved
src/Symfony/Component/Serializer/Normalizer/DataUriNormalizer.php
Outdated
Show resolved
Hide resolved
2b1e6cc
to
5268389
Compare
This PR was squashed before being merged into the 4.3-dev branch (closes #29896). Discussion ---------- [Mime] Add the component | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #28832 #21985 makes #15460 trivial | License | MIT | Doc PR | symfony/symfony-docs#10886 This has been on my todo-list for X years :) Commits ------- bdca5d9 tweaked code 5268389 [Mime] added freedesktop as a source for mime types 74ca91d [Mime] added the component d7ee0ec [HttpFoundation] updated File code
…anagi) This PR was merged into the 5.0-dev branch. Discussion ---------- [Serializer] Remove last deprecated/obsolete paths | Q | A | ------------- | --- | Branch? | master <!-- see below --> | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #28316, #28709, #31030, #27020, #29896, 16f8a13#r201060750 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A <!-- required for new features --> This should fix the last deprecations & obsolete code paths for the Serializer component. Commits ------- c703b35 [Serializer] Remove last deprecated/obsolete paths
This has been on my todo-list for X years :)