|
eZ Publish
[4.2]
|
Detection and management of MIME types. More...
Public Member Functions | |
| eZMimeType () | |
Static Public Member Functions | |
| static | changeBasename (&$mimeInfo, $basename) |
| static | changeDirectoryPath (&$mimeInfo, $dirpath) |
| static | changeFileData (&$mimeInfo, $dirpath=false, $basename=false, $suffix=false, $filename=false) |
| static | changeMIMEType (&$mimeInfo, $mimetype) |
| static | defaultMimeType () |
| static | defaultValue ($url, $returnDefault) |
| static | findByBuffer ($buffer, $length=false, $offset=false, $url=false, $returnDefault=true) |
| static | findByFileContents ($url, $returnDefault=true) |
| static | findByName ($mimeName, $returnDefault=true) |
| static | findByURL ($url, $returnDefault=true) |
| static | instance () |
| Returns a shared instance of the eZMimeType class. | |
| static | mimeTypeFor ($path, $file) |
Public Attributes | |
| $MIMEList | |
| An associative array which maps MIME type name to MIME structure. | |
| $PrefixList | |
| An associative array which maps from prefix name to MIME type name. | |
| $QuickContentMatch | |
| $QuickMIMETypes = array() | |
| A list of suffixes and their MIME types, this is used to quickly initialize the system. | |
| $SuffixList | |
| An associative array which maps from suffix name to MIME type name. | |
Static Private Member Functions | |
| static | preparePrefixList (&$prefixList, $mimeList) |
| static | prepareSuffixList (&$suffixList, $mimeList) |
Detection and management of MIME types.
The MIME type structure is an array with the following items:
false if no match for the file was found in which case the name will also be application/octet-streamfalse if buffer matching was used.false if nonefalse if none Definition at line 56 of file ezmimetype.php.
| static eZMimeType::changeBasename | ( | &$ | mimeInfo, |
| $ | basename | ||
| ) | [static] |
Changes the basename attribute for the MIME info structure $mimeInfo to $basename, and recreates all the affected fields.
Definition at line 167 of file ezmimetype.php.
Referenced by eZImageManager\createImageAlias().
| static eZMimeType::changeDirectoryPath | ( | &$ | mimeInfo, |
| $ | dirpath | ||
| ) | [static] |
Changes the basename attribute for the MIME info structure $mimeInfo to $basename, and recreates all the affected fields.
Definition at line 181 of file ezmimetype.php.
Referenced by eZStylePackageCreator\commitCSSFile(), eZImageManager\convert(), eZImageAliasHandler\initializeFromFile(), eZImageAliasHandler\initializeFromHTTPFile(), eZStylePackageCreator\validateImageFiles(), and eZPackageCreationHandler\validatePackageThumbnail().
| static eZMimeType::changeFileData | ( | &$ | mimeInfo, |
| $ | dirpath = false, |
||
| $ | basename = false, |
||
| $ | suffix = false, |
||
| $ | filename = false |
||
| ) | [static] |
Changes the basename attribute for the MIME info structure $mimeInfo to $basename, and recreates all the affected fields.
Definition at line 194 of file ezmimetype.php.
Referenced by eZImageManager\convert(), and eZImageAliasHandler\updateAliasPath().
| static eZMimeType::changeMIMEType | ( | &$ | mimeInfo, |
| $ | mimetype | ||
| ) | [static] |
Changes the MIME type attribute for the MIME info structure $mimeInfo to $mimetype, and recreates all the affected fields.
Definition at line 143 of file ezmimetype.php.
Referenced by eZImageManager\convert(), and eZImageManager\imageAliasInfo().
| static eZMimeType::defaultMimeType | ( | ) | [static] |
Definition at line 94 of file ezmimetype.php.
Referenced by defaultValue().
| static eZMimeType::defaultValue | ( | $ | url, |
| $ | returnDefault | ||
| ) | [static] |
true, otherwise returns false. Definition at line 112 of file ezmimetype.php.
Referenced by findByName(), and findByURL().
| eZMimeType::eZMimeType | ( | ) |
| static eZMimeType::findByBuffer | ( | $ | buffer, |
| $ | length = false, |
||
| $ | offset = false, |
||
| $ | url = false, |
||
| $ | returnDefault = true |
||
| ) | [static] |
Finds the MIME type for the buffer $buffer by examining the contents and returns it. If $returnDefault is set to true then it will always return a MIME structure, if not it will return false if none were found.
| $length | If specified it will limit how far the $buffer is examined |
| $offset | If specified it will set the starting point for the $buffer examination |
| $url | If specified the url will be used for MIME determination if buffer examination gives no results. |
Definition at line 349 of file ezmimetype.php.
| static eZMimeType::findByFileContents | ( | $ | url, |
| $ | returnDefault = true |
||
| ) | [static] |
Finds the MIME type for the url $url by examining the contents of the url and returns it. If $returnDefault is set to true then it will always return a MIME structure, if not it will return false if none were found.
Definition at line 334 of file ezmimetype.php.
Referenced by eZPDFTable\callImage(), eZStylePackageCreator\commitCSSFile(), eZImageManager\convert(), copyImagesToDB(), eZImageManager\createImageAlias(), eZContentUpload\fetchHTTPFile(), eZMediaType\fetchObjectAttributeHTTPInput(), eZBinaryFileType\fetchObjectAttributeHTTPInput(), eZWebDAVContentServer\fetchVirtualSiteContent(), eZImageAliasHandler\generateXMLData(), eZContentUpload\handleLocalFile(), eZImageManager\imageAliasInfo(), eZImageAliasHandler\initializeFromFile(), eZImageAliasHandler\initializeFromHTTPFile(), eZBinaryFileType\insertRegularFile(), eZMediaType\insertRegularFile(), eZFSFileHandler\passthrough(), eZImageAliasHandler\recreateDOMTree(), eZBinaryFileHandler\storedFilename(), eZStylePackageCreator\validateImageFiles(), and eZPackageCreationHandler\validatePackageThumbnail().
| static eZMimeType::findByName | ( | $ | mimeName, |
| $ | returnDefault = true |
||
| ) | [static] |
true then it will always return a MIME structure, if not it will return false if none were found. Definition at line 223 of file ezmimetype.php.
Referenced by changeMIMEType(), eZWebDAVContentServer\fetchNodeInfo(), eZWebDAVContentBackend\fetchNodeInfo(), eZImageAliasHandler\initializeFromHTTPFile(), and eZImageHandler\outputMIMEType().
| static eZMimeType::findByURL | ( | $ | url, |
| $ | returnDefault = true |
||
| ) | [static] |
Finds the MIME type for the url $url by examining the url itself (not the content) and returns it. If $returnDefault is set to true then it will always return a MIME structure, if not it will return false if none were found.
Definition at line 253 of file ezmimetype.php.
Referenced by eZPDFTable\callImage(), eZFile\download(), eZHTTPFile\fetch(), eZWebDAVContentServer\fetchNodeInfo(), eZWebDAVContentBackend\fetchNodeInfo(), findByBuffer(), findByFileContents(), getFileInfo(), eZImageAliasHandler\initializeFromHTTPFile(), mimeTypeFor(), eZWebDAVServer\outputSendDataToClient(), eZWebDAVContentServer\putContentData(), eZImageAliasHandler\recreateDOMTree(), eZTemplateImageOperator\storeImage(), and eZImageType\validateObjectAttributeHTTPInput().
| static eZMimeType::instance | ( | ) | [static] |
Returns a shared instance of the eZMimeType class.
Definition at line 359 of file ezmimetype.php.
Referenced by eZMimeType(), findByName(), and findByURL().
| static eZMimeType::mimeTypeFor | ( | $ | path, |
| $ | file | ||
| ) | [static] |
Definition at line 374 of file ezmimetype.php.
| static eZMimeType::preparePrefixList | ( | &$ | prefixList, |
| $ | mimeList | ||
| ) | [static, private] |
Goes trough the mime list and creates a reference to the mime entry using the primary prefix.
Definition at line 413 of file ezmimetype.php.
Referenced by eZMimeType().
| static eZMimeType::prepareSuffixList | ( | &$ | suffixList, |
| $ | mimeList | ||
| ) | [static, private] |
Goes trough the mime list and creates a reference to the mime entry using the primary suffix.
Definition at line 394 of file ezmimetype.php.
Referenced by eZMimeType().
| eZMimeType::$MIMEList |
An associative array which maps MIME type name to MIME structure.
Definition at line 435 of file ezmimetype.php.
| eZMimeType::$PrefixList |
An associative array which maps from prefix name to MIME type name.
Definition at line 433 of file ezmimetype.php.
| eZMimeType::$QuickContentMatch |
array(
array( array( 0, 'string', 'GIF87a', 'image/gif' ),
array( 0, 'string', 'GIF89a', 'image/gif' ) )
)
Definition at line 437 of file ezmimetype.php.
| eZMimeType::$QuickMIMETypes = array() |
A list of suffixes and their MIME types, this is used to quickly initialize the system.
Definition at line 443 of file ezmimetype.php.
| eZMimeType::$SuffixList |
An associative array which maps from suffix name to MIME type name.
Definition at line 431 of file ezmimetype.php.