Issue #2417071 by chintan.vyas: Remove file_get_mimetype
parent
66b5cb9b8c
commit
6a88305516
|
@ -1110,32 +1110,6 @@ function file_upload_max_size() {
|
|||
return $max_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines an Internet Media Type or MIME type from a filename.
|
||||
*
|
||||
* @param $uri
|
||||
* A string containing the URI, path, or filename.
|
||||
* @param $mapping
|
||||
* An optional map of extensions to their mimetypes, in the form:
|
||||
* - 'mimetypes': a list of mimetypes, keyed by an identifier,
|
||||
* - 'extensions': the mapping itself, an associative array in which the key
|
||||
* is the extension (lowercase) and the value is the mimetype identifier.
|
||||
*
|
||||
* @return
|
||||
* The internet media type registered for the extension or
|
||||
* application/octet-stream for unknown extensions.
|
||||
*
|
||||
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0. Calls are
|
||||
* passed on to a new file.mime_type.guesser service, and the $mapping
|
||||
* parameter is ignored. Use
|
||||
* \Drupal::service('file.mime_type.guesser')->guess($uri).
|
||||
*
|
||||
* @see \Drupal\Core\File\MimeType\ExtensionMimeTypeGuesser::guess()
|
||||
*/
|
||||
function file_get_mimetype($uri, $mapping = NULL) {
|
||||
return \Drupal::service('file.mime_type.guesser')->guess($uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the permissions on a file or directory.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue