Omeka_File_MimeType_Detect

Package: File\MimeType\Detect

class Omeka_File_MimeType_Detect

Represents the detected MIME types of a file.

property _file

protected string

property _strategies

protected array

property _mimeType

protected string

property _mimeTypes

protected array

property _ambiguousMimeTypes

protected array

__construct($file, $strategies = array())

Set the required properties for detecting the MIME types of a file.

Parameters:
  • $file (string|File) – The full path to the file or a File record.

  • $strategies (array) – An array of file detection strategies in priority order. If none are passed, a default list will be set. All strategies must implement Omeka_File_MimeType_Detect_StrategyInterface.

detect()

Detect the MIME type of this file.

Returns:

string The definitive MIME type.

getMimeType()

Get the definitive MIME type of this file.

Returns:

string

getMimeTypes()

Get the MIME types of this file, one for each detection strategy.

Returns:

array