Elgg
Version 6.1
|
Public service related to MIME type detection. More...
Public Member Functions | |
__construct (protected EventsService $events) | |
Constructor. More... | |
getMimeType (string $filename, string $default=MimeTypeDetector::DEFAULT_TYPE) | |
Get the mimetype for a given filename. More... | |
getSimpleType (string $mimetype, string $default= 'general') | |
Returns the category of a file from its MIME type. More... | |
getSimpleTypeFromFile (string $filename, string $default= 'general') | |
Returns the category of a file from a filename. More... | |
Public service related to MIME type detection.
Definition at line 13 of file MimeTypeService.php.
Elgg\Filesystem\MimeTypeService::__construct | ( | protected EventsService | $events | ) |
Constructor.
EventsService | $events | Events service |
Definition at line 20 of file MimeTypeService.php.
Elgg\Filesystem\MimeTypeService::getMimeType | ( | string | $filename, |
string | $default = MimeTypeDetector::DEFAULT_TYPE |
||
) |
Get the mimetype for a given filename.
string | $filename | Filename to check |
string | $default | Default mimetype if not detected (default: application/octet-stream) |
InvalidArgumentException |
Definition at line 32 of file MimeTypeService.php.
Elgg\Filesystem\MimeTypeService::getSimpleType | ( | string | $mimetype, |
string | $default = 'general' |
||
) |
Returns the category of a file from its MIME type.
string | $mimetype | The MIME type |
string | $default | Default MIME type if detection fails (default: general) |
Definition at line 58 of file MimeTypeService.php.
Elgg\Filesystem\MimeTypeService::getSimpleTypeFromFile | ( | string | $filename, |
string | $default = 'general' |
||
) |
Returns the category of a file from a filename.
string | $filename | The filename to check |
string | $default | Default MIME type if detection fails (default: general) |
Definition at line 95 of file MimeTypeService.php.