Class: I2CE MimeTypes (Development)
From IHRIS Wiki
For other versions, see Class: I2CE_MimeTypes (versions) .
This article describes the class I2CE_MimeTypes .
- Location: Part of the module MimeTypes in the package I2CE 4.1-dev
- Source: Defined in the file modules/MimeTypes/lib/I2CE_MimeTypes.php on line 29
- Author: Carl Leitner <litlfred@ibiblio.org>
class that will handle trying to figure out mime types in various ways.
Variables
$finfo
protected static @var finfo $finfo. See http://us2.php.net/fileinfo
- Defined in i2ce/modules/MimeTypes/lib/I2CE_MimeTypes.php on line 34
- Type: static protected $finfo
$extToMimeTypes
protected static @var array $extToMimeTypes an array with keys file extensions and values mime types
- Defined in i2ce/modules/MimeTypes/lib/I2CE_MimeTypes.php on line 77
- Type: static protected $extToMimeTypes
Methods
extToMimeType()
Given a file extension, it determine the mime-type
- Defined in i2ce/modules/MimeTypes/lib/I2CE_MimeTypes.php on line 125
- Signature: static public function extToMimeType($ext)
- Parameters:
- string $ext
Either a file name or extension
- string $ext
- Returns: string
The mime-type, or null if not found.
loadMimeTypes()
Loads in the file containing mime types and extensions
- Defined in i2ce/modules/MimeTypes/lib/I2CE_MimeTypes.php on line 85
- Signature: static protected function loadMimeTypes()
magicMimeType()
Tries to determine the file type magically
- Defined in i2ce/modules/MimeTypes/lib/I2CE_MimeTypes.php on line 41
- Signature: static public function magicMimeType($data)
- Parameters:
- string $data
- Returns: a
string, the mime type, or null if none was found.
mimeTypeToExt()
Get a file extension for the associated mime type
- Defined in i2ce/modules/MimeTypes/lib/I2CE_MimeTypes.php on line 143
- Signature: static public function mimeTypeToExt($mime_type)
- Parameters:
- string $mime_type
- Returns: mixed.
String, the extension, on success, false on failure