Oihana PHP

FileMimeType uses ConstantsTrait

FileExtension

Enumeration class that defines various file mime-types supported by the application.

Tags
author

Marc Alcaraz (ekameleon)

since
1.0.0

Table of Contents

Constants

AAC  = 'audio/aac'
ACCDB  = 'application/msaccess'
AI  = ['application/postscript', 'application/illustrator']
APP  = 'application/octet-stream'
AVI  = 'video/x-msvideo'
BAT  = 'application/x-bat'
BMP  = 'image/bmp'
COM  = 'application/x-msdownload'
CSS  = 'text/css'
CSV  = 'text/csv'
DB  = 'application/octet-stream'
DLL  = 'application/x-msdownload'
DMG  = 'application/x-apple-diskimage'
DOC  = 'application/msword'
DOCX  = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
ENCRYPTED  = 'application/octet-stream'
EXE  = ['application/x-msdownload', 'application/vnd.microsoft.portable-executable']
FLAC  = 'audio/flac'
FLV  = 'video/x-flv'
GIF  = 'image/gif'
GZ  = 'application/gzip'
HTM  = 'text/html'
HTML  = 'text/html'
ICO  = 'image/vnd.microsoft.icon'
JAR  = 'application/java-archive'
JPEG  = 'image/jpeg'
JPG  = 'image/jpeg'
JS  = ['application/javascript', 'text/javascript']
JSON  = 'application/json'
M4A  = ['audio/mp4', 'audio/x-m4a']
M4V  = ['video/x-m4', 'video/mp4v']
MD  = 'text/markdown'
MDB  = 'application/x-msaccess'
MKV  = 'video/x-matroska'
MOV  = 'video/quicktime'
MP3  = 'audio/mpeg'
MP4  = 'video/mp4'
MPEG  = 'video/mpeg'
MPG  = 'video/mpeg'
ODP  = 'application/vnd.oasis.opendocument.presentation'
ODS  = 'application/vnd.oasis.opendocument.spreadsheet'
ODT  = 'application/vnd.oasis.opendocument.text'
OGG  = 'audio/ogg'
OTF  = 'font/otf'
PDF  = 'application/pdf'
PHP  = ['application/x-php', 'application/x-httpd-php', 'application/x-httpd-php-source', 'text/php', 'text/x-php', 'application/php']
PNG  = 'image/png'
PPT  = 'application/vnd.ms-powerpoint'
PPTX  = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
PSD  = 'image/vnd.adobe.photoshop'
RAR  = 'application/vnd.rar'
RTF  = 'application/rtf'
SEVEN_Z  = 'application/x-7z-compressed'
SH  = 'application/x-sh'
SQL  = 'application/sql'
SQLITE  = 'application/vnd.sqlite3'
SVG  = 'image/svg+xml'
TAR  = ['application/tar', 'application/x-tar']
TAR_BZ2  = 'application/x-bzip2'
TAR_GZ  = 'application/gzip'
TAR_GZ_ENCRYPTED  = 'application/octet-stream'
TGZ  = 'application/gzip'
TIF  = 'image/tiff'
TIFF  = 'image/tiff'
TOML  = 'application/toml'
TTF  = 'font/ttf'
TXT  = 'text/plain'
WAV  = 'audio/wav'
WEBM  = 'video/webm'
WEBP  = 'image/webp'
WMA  = 'audio/x-ms-wma'
WMV  = 'video/x-ms-wmv'
WOFF  = 'font/woff'
WOFF2  = 'font/woff2'
XLS  = 'application/vnd.ms-excel'
XLSX  = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
XML  = 'application/xml'
YAML  = ['application/x-yaml', 'text/yaml']
YML  = 'application/x-yaml'
ZIP  = 'application/zip'

Properties

$EXTENSIONS  : array<string|int, mixed>|null

Methods

getExtension()  : string|array<string|int, mixed>|null
Returns the mimetype(s) for a given code.
getFromExtension()  : array<string|int, mixed>|string|null
Returns the extension(s) of the specific mime-type value.
resetCaches()  : void
Reset the internal cache of the static methods.

Constants

AI

public mixed AI = ['application/postscript', 'application/illustrator']

DOCX

public mixed DOCX = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'

ENCRYPTED

public mixed ENCRYPTED = 'application/octet-stream'

EXE

public mixed EXE = ['application/x-msdownload', 'application/vnd.microsoft.portable-executable']

JS

public mixed JS = ['application/javascript', 'text/javascript']

ODP

public mixed ODP = 'application/vnd.oasis.opendocument.presentation'

ODS

public mixed ODS = 'application/vnd.oasis.opendocument.spreadsheet'

ODT

public mixed ODT = 'application/vnd.oasis.opendocument.text'

PHP

public mixed PHP = ['application/x-php', 'application/x-httpd-php', 'application/x-httpd-php-source', 'text/php', 'text/x-php', 'application/php']

PPTX

public mixed PPTX = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'

SEVEN_Z

public mixed SEVEN_Z = 'application/x-7z-compressed'

TAR

public mixed TAR = ['application/tar', 'application/x-tar']

TAR_GZ_ENCRYPTED

public mixed TAR_GZ_ENCRYPTED = 'application/octet-stream'

XLSX

public mixed XLSX = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'

YAML

public mixed YAML = ['application/x-yaml', 'text/yaml']

Properties

$EXTENSIONS

private static array<string|int, mixed>|null $EXTENSIONS = null

Methods

getExtension()

Returns the mimetype(s) for a given code.

public static getExtension(string $mimeType) : string|array<string|int, mixed>|null
Parameters
$mimeType : string

The mime type to evaluates.

Return values
string|array<string|int, mixed>|null

getFromExtension()

Returns the extension(s) of the specific mime-type value.

public static getFromExtension(string $extension) : array<string|int, mixed>|string|null
Parameters
$extension : string

The extension to evaluates.

Return values
array<string|int, mixed>|string|null

resetCaches()

Reset the internal cache of the static methods.

public static resetCaches() : void

        
On this page

Search results