-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Automatically generate file props from path #360
Conversation
} | ||
|
||
if (null === $mimeType) { | ||
$mimeType = mime_content_type($path); |
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.
May be use the mime type guesser from Symfony here instead?
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.
any hint what that looks like?
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.
You could instantiate it yourself via (new MimeTypes())->guessMimeType($path)
. However, the symfony/framework-bundle
also registers it as the mime_types
service, which allows the system to add additional guessers via the MimeTypeGuesserInterface
via the AddMimeTypeGuesserPass
compiler pass. This would have to be done via a helper service outside this static function.
I would like to have a separate helper method. Less magic, more expressive. |
but that method already is a helper method to create a |
Yes but right now, |
I think we should introduce a |
Closing in favor of #362. |
would be quite cumbersome if everyone has to do that themselve?