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