Arikaim CMS

FileType
in package

File type

Table of Contents

Properties

$filesType  : array<string|int, mixed>
File type items

Methods

getFileType()  : string|false
Get file type
getFileTypeItem()  : array<string|int, mixed>|false
Get file type item info
isApplication()  : bool
Return true if file is application
isAudio()  : bool
Return true if file is audio
isDirectory()  : bool
Return true if file type is directory
isFileType()  : bool
Return true if file have mime type
isFont()  : bool
Return true if file is font
isImage()  : bool
Return true if file is image
isPdf()  : bool
Return true if file is pdf
isText()  : bool
Return true if file is text
isVideo()  : bool
Return true if file is video
isZip()  : bool
Return true if file type is zip

Properties

$filesType

File type items

private static array<string|int, mixed> $filesType = ['image' => ['start' => 0, 'length' => 5], 'video' => ['start' => 0, 'length' => 5], 'audio' => ['start' => 0, 'length' => 5], 'pdf' => ['start' => -3, 'length' => 3], 'text' => ['start' => 0, 'length' => 4], 'font' => ['start' => 0, 'length' => 4], 'zip' => ['items' => ['application/zip', 'application/x-zip-compressed', 'multipart/x-zip']], 'application' => ['start' => 0, 'length' => 11]]

Methods

getFileType()

Get file type

public static getFileType(string $mimeType) : string|false
Parameters
$mimeType : string
Return values
string|false

getFileTypeItem()

Get file type item info

public static getFileTypeItem(string $type) : array<string|int, mixed>|false
Parameters
$type : string
Return values
array<string|int, mixed>|false

isApplication()

Return true if file is application

public static isApplication(string $mimeType) : bool
Parameters
$mimeType : string
Return values
bool

isAudio()

Return true if file is audio

public static isAudio(string $mimeType) : bool
Parameters
$mimeType : string
Return values
bool

isDirectory()

Return true if file type is directory

public static isDirectory(string $mimeType) : bool
Parameters
$mimeType : string
Return values
bool

isFileType()

Return true if file have mime type

public static isFileType(string $type, string $mimeType) : bool
Parameters
$type : string

one from: image,video,audio,application,text,pdd,font

$mimeType : string
Return values
bool

isFont()

Return true if file is font

public static isFont(string $mimeType) : bool
Parameters
$mimeType : string
Return values
bool

isImage()

Return true if file is image

public static isImage(string $mimeType) : bool
Parameters
$mimeType : string
Return values
bool

isPdf()

Return true if file is pdf

public static isPdf(string $mimeType) : bool
Parameters
$mimeType : string
Return values
bool

isText()

Return true if file is text

public static isText(string $mimeType) : bool
Parameters
$mimeType : string
Return values
bool

isVideo()

Return true if file is video

public static isVideo(string $mimeType) : bool
Parameters
$mimeType : string
Return values
bool

isZip()

Return true if file type is zip

public static isZip(string $mimeType) : bool
Parameters
$mimeType : string
Return values
bool

        
On this page

Search results