LSFileHelper

Extends \CFileHelper

package

Default

Methods

getExtensionByMimeType

getExtensionByMimeType( $file,  $magicFile = null) : string|null
static
inheritdoc

Can not call parent since usage of self::getMimeType Set $magicFile (php array) from config (if is null)

see https://www.yiiframework.com/doc/api/1.1/CFileHelper#getExtensionByMimeType-detail

Arguments

$file

$magicFile

Response

string|null

extension name. Null is returned if the extension cannot be determined.

getMimeType

getMimeType( $file,  $magicFile = null,  $checkExtension = true) : string|null
static
inheritdoc

Set $magicFile (magic dataBase) from config (if is null) Use the magic file set by user only iof needed (else keep pĥp default or MAGIC env)

see https://www.php.net/manual/en/function.finfo-open.php

Arguments

$file

$magicFile

$checkExtension

Response

string|null

string if the MIME type. Null is returned if the MIME type cannot be determined.