Class MimeClass

Description

This class inspired by Chris Jean's work, here: http://chrisjean.com/2009/02/14/generating-mime-type-in-php-is-not-magic/

It does some MIME trickery, inspired by the need to to deal with Openoffice and MS Office 2007 file formats -- which are often mis-interpreted by mime-magic, fileinfo, and the *nix `file` command.

In Drupal 6, we also make use of file_get_mimetype. See: http://api.drupal.org/api/function/file_get_mimetype/6 ... however this only provides a uni-directional lookup (ext->mime). While I don't have a specific use case for a mime->extension lookup, I think it's good to have in here.

Drupal 7 will have better mime handlers. See: http://api.drupal.org/api/function/file_default_mimetype_mapping/7

Located in /MimeClass.inc (line 29)


	
			
Method Summary
 MimeClass __construct ()
 void getType ( $filename)
 void get_extension ( $mime_type, [ $debug = FALSE])
 void get_mimetype ( $filename, [ $debug = FALSE])
Methods
Constructor __construct (line 204)
  • access: public
MimeClass __construct ()
getType (line 221)

function: getType description: An alias to get_mimetype, for backwards-compatibility with our old mimetype class.

  • access: public
void getType ( $filename)
  • $filename
get_extension (line 267)

function: get_extension

description: returns *one* valid file extension for a given $mime_type

  • access: public
void get_extension ( $mime_type, [ $debug = FALSE])
  • $mime_type
  • $debug
get_mimetype (line 229)

function: get_mimetype

description: returns a mimetype associated with the file extension of $filename

  • access: public
void get_mimetype ( $filename, [ $debug = FALSE])
  • $filename
  • $debug

Documentation generated on Thu, 14 Jul 2011 16:56:05 -0300 by phpDocumentor 1.4.3