Documentation

MimeType
in package

Mime types.

Table of Contents

Properties

$data  : string
$isAudio  : bool
$isCapable  : bool
$isFlash  : bool
$isFlashVideo  : bool
$isImage  : bool
$isValid  : bool
$isVideo  : bool
$isViewable  : bool
$type  : string
$browserCapableTypes  : array<string|int, mixed>
List of types compatible with browsers.
$mime_types  : array<string|int, mixed>
List of MIME types.
$_type  : string
File type.

Methods

__construct()  : mixed
Constructor.
__get()  : mixed
Create()  : MimeType
Creates an MimeType object for given file name
GetType()  : string
Returns file type by mimetype given
GetTypeFromFileName()  : string|null
Returns file type by given file name
getPropertyData()  : string
Returns mimetype by given file type
getPropertyIsAudio()  : bool
Returns if the file type is audio file type
getPropertyIsCapable()  : bool
Returns if type is compatible with browsers
getPropertyIsFlash()  : bool
Returns if the file type is the flash object
getPropertyIsFlashVideo()  : bool
Returns if the file type is the flash video object
getPropertyIsImage()  : bool
Returns if the file type is image file type
getPropertyIsValid()  : bool
Returns if the file type is valid
getPropertyIsVideo()  : bool
Returns if the file type is videofile type
getPropertyIsViewable()  : bool
Returns if the file type is viewable
getPropertyType()  : bool
Returns if the file type in this object
_loadAndSave()  : void
_loadMimeTypes()  : mixed

Properties

$isCapable read-only

public bool $isCapable

$isFlashVideo read-only

public bool $isFlashVideo

$isViewable read-only

public bool $isViewable

$browserCapableTypes

List of types compatible with browsers.

protected static array<string|int, mixed> $browserCapableTypes = array("jpg", "png", "gif", "swf", "html", "htm", "css", "js", "xml", "xsl")

$mime_types

List of MIME types.

protected static array<string|int, mixed> $mime_types = []

Methods

__construct()

Constructor.

public __construct(string $type) : mixed
Parameters
$type : string

The file type.

__get()

public __get(string $field) : mixed
Parameters
$field : string

Create()

Creates an MimeType object for given file name

public static Create(string $filename) : MimeType
Parameters
$filename : string
Return values
MimeType

GetType()

Returns file type by mimetype given

public static GetType(string $mimetype) : string
Parameters
$mimetype : string
Return values
string

GetTypeFromFileName()

Returns file type by given file name

public static GetTypeFromFileName(string $filename) : string|null
Parameters
$filename : string
Return values
string|null

getPropertyData()

Returns mimetype by given file type

protected getPropertyData() : string
Return values
string

getPropertyIsAudio()

Returns if the file type is audio file type

protected getPropertyIsAudio() : bool
Return values
bool

getPropertyIsCapable()

Returns if type is compatible with browsers

protected getPropertyIsCapable() : bool
Return values
bool

getPropertyIsFlash()

Returns if the file type is the flash object

protected getPropertyIsFlash() : bool
Return values
bool

getPropertyIsFlashVideo()

Returns if the file type is the flash video object

protected getPropertyIsFlashVideo() : bool
Return values
bool

getPropertyIsImage()

Returns if the file type is image file type

protected getPropertyIsImage() : bool
Return values
bool

getPropertyIsValid()

Returns if the file type is valid

protected getPropertyIsValid() : bool
Return values
bool

getPropertyIsVideo()

Returns if the file type is videofile type

protected getPropertyIsVideo() : bool
Return values
bool

getPropertyIsViewable()

Returns if the file type is viewable

protected getPropertyIsViewable() : bool
Return values
bool

getPropertyType()

Returns if the file type in this object

protected getPropertyType() : bool
Return values
bool

_loadAndSave()

private _loadAndSave() : void

_loadMimeTypes()

private _loadMimeTypes() : mixed

        
On this page

Search results