protected static loadMimeTypes ( string $magicFile ) : array | ||
$magicFile | string | the path (or alias) of the file that contains all available MIME type information. If this is not set, the file specified by [[mimeMagicFile]] will be used. |
return | array | the mapping from file extensions to MIME types |
protected static function loadMimeTypes($magicFile)
{
if ($magicFile === null) {
$magicFile = static::$mimeMagicFile;
}
$magicFile = Yii::getAlias($magicFile);
if (!isset(self::$_mimeTypes[$magicFile])) {
self::$_mimeTypes[$magicFile] = (require $magicFile);
}
return self::$_mimeTypes[$magicFile];
}