Oihana PHP

FileExtension uses ConstantsTrait

FileExtension

Enumeration class that defines various file extension supported by the application.

Tags
author

Marc Alcaraz (ekameleon)

since
1.0.0

Table of Contents

Constants

AAC  : string = '.aac'
ACCDB  : string = '.accdb'
AI  : string = '.ai'
APP  : string = '.app'
AVI  : string = '.avi'
AVIF  : string = '.avif'
BAT  : string = '.bat'
BMP  : string = '.bmp'
BZ2  : string = '.bz2'
CBOR  : string = '.cbor'
CBOR_SEQ  : string = '.cbor.seq'
COM  : string = '.com'
COSE  : string = '.cose'
COSE_ENCRYPTED  : string = '.cose.enc'
CSS  : string = '.css'
CSV  : string = '.csv'
CUR  : string = '.cur'
DB  : string = '.db'
DLL  : string = '.dll'
DMG  : string = '.dmg'
DOC  : string = '.doc'
DOCX  : string = '.docx'
ENCRYPTED  : string = '.enc'
EXE  : string = '.exe'
FLAC  : string = '.flac'
FLV  : string = '.flv'
GIF  : string = '.gif'
GZ  : string = '.gz'
HEIC  : string = '.heic'
HEIF  : string = '.heif'
HTM  : string = '.htm'
HTML  : string = '.html'
ICO  : string = '.ico'
JAR  : string = '.jar'
JPEG  : string = '.jpeg'
JPG  : string = '.jpg'
JS  : string = '.js'
JSON  : string = '.json'
M4A  : string = '.m4a'
M4V  : string = '.m4v'
MD  : string = '.md'
MDB  : string = '.mdb'
MKV  : string = '.mkv'
MOV  : string = '.mov'
MP3  : string = '.mp3'
MP4  : string = '.mp4'
MPEG  : string = '.mpeg'
MPG  : string = '.mpg'
ODP  : string = '.odp'
ODS  : string = '.ods'
ODT  : string = '.odt'
OGG  : string = '.ogg'
OTF  : string = '.otf'
PDF  : string = '.pdf'
PHP  : string = '.php'
PNG  : string = '.png'
PPT  : string = '.ppt'
PPTX  : string = '.pptx'
PSD  : string = '.psd'
RAR  : string = '.rar'
RTF  : string = '.rtf'
SEVEN_Z  : string = '.7z'
SH  : string = '.sh'
SQL  : string = '.sql'
SQLITE  : string = '.sqlite'
SVG  : string = '.svg'
TAR  : string = '.tar'
TAR_BZ2  : string = '.tar.bz2'
TAR_GZ  : string = '.tar.gz'
TAR_GZ_ENCRYPTED  : string = '.tar.gz.enc'
TGZ  : string = '.tgz'
TIF  : string = '.tif'
TIFF  : string = '.tiff'
TOML  : string = '.toml'
TTF  : string = '.ttf'
TXT  : string = '.txt'
WAV  : string = '.wav'
WEBM  : string = '.webm'
WEBP  : string = '.webp'
WMA  : string = '.wma'
WMV  : string = '.wmv'
WOFF  : string = '.woff'
WOFF2  : string = '.woff2'
XLS  : string = '.xls'
XLSX  : string = '.xlsx'
XML  : string = '.xml'
YAML  : string = '.yaml'
YML  : string = '.yml'
ZIP  : string = '.zip'

Properties

$MIME_TYPES  : array<string|int, mixed>|null
$MULTIPLE_EXTENSIONS  : array<string|int, mixed>|null

Methods

getFromMimeType()  : array<string|int, mixed>|string|null
Returns the extension(s) of the specific mime-type value.
getMimeType()  : string|array<string|int, mixed>|null
Returns the mimetype(s) for a given extension.
getMultiplePartExtensions()  : array<string|int, mixed>
Returns the list of all multiple part extensions, ex: [ '.tar.gz.enc' , '.tar.gz' , ... ]
resetCaches()  : void
Reset the internal cache of the static methods.

Constants

TAR_GZ_ENCRYPTED

public string TAR_GZ_ENCRYPTED = '.tar.gz.enc'

Properties

$MIME_TYPES

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

$MULTIPLE_EXTENSIONS

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

Methods

getFromMimeType()

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

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

The mime-type to evaluates.

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

getMimeType()

Returns the mimetype(s) for a given extension.

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

getMultiplePartExtensions()

Returns the list of all multiple part extensions, ex: [ '.tar.gz.enc' , '.tar.gz' , ... ]

public static getMultiplePartExtensions([array<string|int, mixed>|null $customs = [] ]) : array<string|int, mixed>
Parameters
$customs : array<string|int, mixed>|null = []

A list of custom multiple part extensions to append in the final list.

Return values
array<string|int, mixed>

resetCaches()

Reset the internal cache of the static methods.

public static resetCaches() : void
On this page

Search results