mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Adding phpdoc to HTTP::get_mime_type()
This commit is contained in:
parent
1e6a52616d
commit
1616bae730
@ -183,7 +183,7 @@ class HTTP {
|
||||
|
||||
/**
|
||||
* Get mime type based on extension
|
||||
*
|
||||
*
|
||||
* @uses finfo
|
||||
* @deprecated Use HTTP::get_mime_type() instead
|
||||
*/
|
||||
@ -193,13 +193,15 @@ class HTTP {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mime type based on extension
|
||||
*
|
||||
* Get mime type based on file extension.
|
||||
*
|
||||
* @uses finfo
|
||||
* @param string $filename Relative path to filename from project root, e.g. "mysite/tests/file.csv"
|
||||
* @return string MIME type
|
||||
*/
|
||||
public static function get_mime_type($filename) {
|
||||
$finfo = new finfo(FILEINFO_MIME_TYPE);
|
||||
return $finfo->file(BASE_PATH.DIRECTORY_SEPARATOR.$filename);
|
||||
return $finfo->file(BASE_PATH . DIRECTORY_SEPARATOR . $filename);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user