Class: I2CE MimeTypes

From IHRIS Wiki
Revision as of 13:09, 19 October 2009 by Litlfred (talk | contribs)

This article describes the class I2CE_MimeTypes.

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

  • Type: static protected $finfo

$extToMimeTypes

protected static @var array $extToMimeTypes an array with keys file extensions and values mime types

  • Type: static protected $extToMimeTypes

Methods

extToMimeType()

Given a file extension, it determine the mime-type

  • Signature: static public function extToMimeType($ext)
  • Parameters:
    • string $ext
      Either a file name or extension
  • Returns: string
    The mime-type, or null if not found.

loadMimeTypes()

Loads in the file containing mime types and extensions

  • Signature: static protected function loadMimeTypes()

magicMimeType()

Tries to determine the file type magically

  • Signature: static public function magicMimeType($data)
  • Parameters:
  • Returns: a
    string, the mime type, or null if none was found.

mimeTypeToExt()

Get a file extension for the associated mime type

  • Signature: static public function mimeTypeToExt($mime_type)
  • Parameters:
  • Returns: mixed.
    String, the extension, on success, false on failure