Overview   Package   Tree   Index 
Tv2 documentation
PREV  NEXT FRAMES  NO FRAME 
SUMMARY:  FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

tv2-engine
Class ctlMimeType


class ctlMimeType

Class for getting mime type of a file or getting extensions for a file with a known type

Authors:
Emilis Dambauskas (emilis@gildija.lt)
Version:
$Id: ctlMimeType.class.php,v 1.1 2003/07/05 09:46:53 lunaticlt Exp $
Copyright:
2002–2003 Emilis Dambauskas under Artistic license

Field Summary
string$default_mime
Default mime type for unknown extensions
private boolean$file_loaded
Specifies if the type map has already benn loaded
private string$mime_file
Mime types file name
private array$mime_types
Type map

Constructor Summary
void ctlMimeType([string $mime_file])
Constructor.

Method Summary
private boolean error(string $msg)
Sends an error to the errors object and returns FALSE
mixed getExtension()
Get extension for a given mime type
mixed getType(string $file_name)
Returns mime type for a given filename
private boolean readMimeFile()
Reads information from type map file


Field Detail

default_mime

string $default_mime

Default mime type for unknown extensions


file_loaded

private boolean $file_loaded

Specifies if the type map has already benn loaded


mime_file

private string $mime_file

Mime types file name


mime_types

private array $mime_types

Type map


Constructor Detail

ctlMimeType()

void ctlMimeType([string $mime_file])

Constructor. Sets attribute values (most importantly mime file name).

Parameters:
mime_file - Filename containing type - extension map

Method Detail

error()

private boolean error(string $msg)

Sends an error to the errors object and returns FALSE

Parameters:
msg - error message
Returns:
always FALSE
Uses the global variables:
errors

getExtension()

mixed getExtension()

Get extension for a given mime type

Returns:
string containing extension or FALSE on failure

getType()

mixed getType(string $file_name)

Returns mime type for a given filename

Parameters:
file_name - File name
Returns:
string with type on success, FALSE on error

readMimeFile()

private boolean readMimeFile()

Reads information from type map file

Returns:
TRUE on success, FALSE on failure

 Overview   Package   Tree   Index 
Tv2 documentation
PREV  NEXT FRAMES  NO FRAME 
SUMMARY:  FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Submit a bug

This document was generated by phpdocgen 0.17-rc3.
Copyright © 2002-03 Stéphane GALLAND (under the GNU General Public License)