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
$data read-only
public
string
$data
$isAudio read-only
public
bool
$isAudio
$isCapable read-only
public
bool
$isCapable
$isFlash read-only
public
bool
$isFlash
$isFlashVideo read-only
public
bool
$isFlashVideo
$isImage read-only
public
bool
$isImage
$isValid read-only
public
bool
$isValid
$isVideo read-only
public
bool
$isVideo
$isViewable read-only
public
bool
$isViewable
$type read-only
public
string
$type
$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
= []
$_type
File type.
private
string
$_type
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
MimeTypeGetType()
Returns file type by mimetype given
public
static GetType(string $mimetype) : string
Parameters
- $mimetype : string
Return values
stringGetTypeFromFileName()
Returns file type by given file name
public
static GetTypeFromFileName(string $filename) : string|null
Parameters
- $filename : string
Return values
string|nullgetPropertyData()
Returns mimetype by given file type
protected
getPropertyData() : string
Return values
stringgetPropertyIsAudio()
Returns if the file type is audio file type
protected
getPropertyIsAudio() : bool
Return values
boolgetPropertyIsCapable()
Returns if type is compatible with browsers
protected
getPropertyIsCapable() : bool
Return values
boolgetPropertyIsFlash()
Returns if the file type is the flash object
protected
getPropertyIsFlash() : bool
Return values
boolgetPropertyIsFlashVideo()
Returns if the file type is the flash video object
protected
getPropertyIsFlashVideo() : bool
Return values
boolgetPropertyIsImage()
Returns if the file type is image file type
protected
getPropertyIsImage() : bool
Return values
boolgetPropertyIsValid()
Returns if the file type is valid
protected
getPropertyIsValid() : bool
Return values
boolgetPropertyIsVideo()
Returns if the file type is videofile type
protected
getPropertyIsVideo() : bool
Return values
boolgetPropertyIsViewable()
Returns if the file type is viewable
protected
getPropertyIsViewable() : bool
Return values
boolgetPropertyType()
Returns if the file type in this object
protected
getPropertyType() : bool
Return values
bool_loadAndSave()
private
_loadAndSave() : void
_loadMimeTypes()
private
_loadMimeTypes() : mixed