Spin off from #2392559: Remove all uses of file_stream_wrapper_get_* and file_get_stream_wrappers
Problem/Motivation
Remove all uses of file_get_mimetype
Proposed resolution
Remove
function file_get_mimetype($uri, $mapping = NULL)
with
\Drupal::service('file.mime_type.guesser')->guess($uri);
API changes
Remove all the uses of following function:
file_get_mimetype
Remaining tasks
Review patch
Beta phase evaluation
| Issue priority | Normal as the patch removes usage of already deprecated functions |
|---|---|
| Prioritized changes | code already marked for removal by 8.0.0 |
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | no-error-patch.png | 4.62 KB | RavindraSingh |
| #5 | remove-uses-of-file_get_mimetype-2415757-3.patch | 4.03 KB | chintan.vyas |
Comments
Comment #1
chintan.vyas commentedRemoved all uses of file_get_mimetype with \Drupal::service('file.mime_type.guesser')->guess($uri);. We need to create subtask for removing function itself.
Comment #2
mondrakeThanks @chintan.vyas!
This should be injected instead of calling \Drupal::service(). Have a look at the patch in the parent issue #2392559-37: Remove all uses of file_stream_wrapper_get_* and file_get_stream_wrappers where that's still in.
Comment #3
chintan.vyas commentedApplied changes from parent issue's patch.
Comment #4
mondrakeJust a couple of doc issues
There should be an empty comment line between the description and the @var.
Missing $ in front of the $module_handler variable.
Can you also post an interdiff in a new patch?
Comment #5
chintan.vyas commentedDocs modifications and interdiff of changes.
Comment #6
mondrakeThanks
Patch in #5 removes all usages of deprecated file_get_mimetype, and fixes two minor doc issues.
RTBC
Comment #7
mondrakeCreated #2417071: Remove file_get_mimetype for function removel, added beta evaluation
Comment #8
mondrakeComment #9
RavindraSingh commentedpatch on #5 works fine. keeping RTBC as same
Comment #11
alexpottCommitted 923527b and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.
@RavindraSingh uploading an image saying that the patch applies is unnecessary on rtbc patches. The rtbc queue is retested by testbot. Also it looks like you are trying to get undeserved commit credit which is unseemly.
Comment #12
RavindraSingh commented@alexpott, This was not my concern to get commit credits. I am aware about that up-loader can be excluded.
Thanks for not adding me in commit message.
Comment #13
alexpott@RavindraSingh that's great - so if you could just post comments instead of uploading images then I have to think less when checking the automatic commit message. Also if you are adding code snippets to issues you can use http://dreditor.org - Plus if you are contributing to Drupal core join #drupal-contribute on IRC and then rather than discussing this in issue comments we can chat in in IRC - see https://www.drupal.org/irc