|
eZ Publish
[trunk]
|
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 33 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 144 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 158 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 171 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 120 of file ezmimetype.php.
Referenced by eZImageManager\convert(), and eZImageManager\imageAliasInfo().
| static eZMimeType::defaultMimeType | ( | ) | [static] |
Definition at line 71 of file ezmimetype.php.
Referenced by defaultValue().
| static eZMimeType::defaultValue | ( | $ | url, |
| $ | returnDefault | ||
| ) | [static] |
true, otherwise returns false. Definition at line 89 of file ezmimetype.php.
Referenced by findByName(), and findByURL().
| 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 326 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 311 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(), 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 200 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 230 of file ezmimetype.php.
Referenced by eZPDFTable\callImage(), eZFile\downloadHeaders(), 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 336 of file ezmimetype.php.
Referenced by eZMimeType(), findByName(), and findByURL().
| static eZMimeType::mimeTypeFor | ( | $ | path, |
| $ | file | ||
| ) | [static] |
Definition at line 351 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 390 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 371 of file ezmimetype.php.
Referenced by eZMimeType().
| eZMimeType::$MIMEList |
An associative array which maps MIME type name to MIME structure.
Definition at line 412 of file ezmimetype.php.
| eZMimeType::$PrefixList |
An associative array which maps from prefix name to MIME type name.
Definition at line 410 of file ezmimetype.php.
| eZMimeType::$QuickContentMatch |
array(
array( array( 0, 'string', 'GIF87a', 'image/gif' ),
array( 0, 'string', 'GIF89a', 'image/gif' ) )
)
Definition at line 414 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 420 of file ezmimetype.php.
| eZMimeType::$SuffixList |
An associative array which maps from suffix name to MIME type name.
Definition at line 408 of file ezmimetype.php.