Validator which checks if the file already exists in the directory
category | Zend |
---|---|
package | Zend_Validate |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Validate_File_MimeType |
__construct(string|array|\Zend_Config $mimetype = array()
)
Mimetype to accept
inherited_from | \Zend_Validate_File_MimeType::__construct() |
---|
string
array
\Zend_Config
__construct(string|array $mimetype)
Mimetype to accept
string
array
MimeType
\Zend_Validate_Exception |
---|
__get(string $property) : mixed
string
\Zend_Validate_Exception |
---|
mixed
addMimeType(string|array $mimetype) : \Zend_Validate_File_Extension
string
array
The mimetypes to add for validation
\Zend_Validate_Exception |
---|
\Zend_Validate_File_Extension
Provides a fluent interfaceenableHeaderCheck(boolean $headerCheck = true
) : \Zend_Validate_File_MimeType
boolean
\Zend_Validate_File_MimeType
Provides a fluent interfacegetDefaultTranslator() : \Zend_Translate_Adapter | null
\Zend_Translate_Adapter
null
getErrors() : array
deprecated | Since 1.5.0 |
---|
array
getHeaderCheck() : boolean
boolean
getMagicFile() : string
Note that for PHP 5.3.0 or higher, we don't use $_ENV['MAGIC'] or try to find a magic file in a common location as PHP now has a built-in internal magic file.
string
getMessageLength() : integer
integer
getMessageTemplates() : array
array
getMessageVariables() : array
array
getMessages() : array
If isValid() was never called or if the most recent isValid() call returned true, then this method returns an empty array.
inherited_from | \Zend_Validate_Interface::getMessages() |
---|
array
getMimeType(boolean $asArray = false
) : string | array
boolean
Returns the values as array, when false an concated string is returned
string
array
getObscureValue() : boolean
boolean
getTranslator() : \Zend_Translate_Adapter | null
\Zend_Translate_Adapter
null
hasDefaultTranslator() : boolean
boolean
hasTranslator() : boolean
boolean
isValid(string $value, array $file = null
) : boolean
Returns true if the mimetype of the file matches the given ones. Also parts of mimetypes can be checked. If you give for example "image" all image mime types will be accepted like "image/gif", "image/jpeg" and so on.
string
Real file to check for mimetype
array
File data from Zend_File_Transfer
boolean
setDefaultTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null
)
\Zend_Translate
\Zend_Translate_Adapter
null
\Zend_Validate_Exception |
---|
setDisableTranslator(boolean $flag) : \Zend_Validate_Abstract
boolean
\Zend_Validate_Abstract
setMagicFile(string $file) : \Zend_Validate_File_MimeType
string
\Zend_Validate_Exception |
When finfo can not read the magicfile |
---|
\Zend_Validate_File_MimeType
Provides a fluent interfacesetMessage(string $messageString, string $messageKey = null
) : \Zend_Validate_Abstract
string
string
OPTIONAL
\Zend_Validate_Exception |
---|
\Zend_Validate_Abstract
Provides a fluent interfacesetMessageLength(integer $length = -1
)
integer
setMessages(array $messages) : \Zend_Validate_Abstract
array
\Zend_Validate_Abstract
setMimeType(string|array $mimetype) : \Zend_Validate_File_Extension
string
array
The mimetypes to validate
\Zend_Validate_File_Extension
Provides a fluent interfacesetObscureValue(boolean $flag) : \Zend_Validate_Abstract
boolean
\Zend_Validate_Abstract
setTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null
) : \Zend_Validate_Abstract
\Zend_Translate
\Zend_Translate_Adapter
null
\Zend_Validate_Exception |
---|
\Zend_Validate_Abstract
setTryCommonMagicFilesFlag(boolean $flag = true
) : \Zend_Validate_File_MimeType
shouldTryCommonMagicFiles() : boolean
translatorIsDisabled() : boolean
boolean
_createMessage(string $messageKey, string $value) : string
Returns null if and only if $messageKey does not correspond to an existing template.
If a translator is available and a translation exists for $messageKey, the translation will be used.
string
string
string
_detectMimeType(string $file) : string
string
File which mime type should be detected
string
File mime type or null if not detected_error(string $messageKey, string $value = null
) : void
string
string
OPTIONAL
_errorHandler(integer $errno, string $errstr, string $errfile, integer $errline)
integer
string
string
integer
_implodeRecursive(array $pieces) : string
array
string
_setValue(mixed $value) : void
mixed
_throw(string $file, string $errorType) : false
inherited_from | \Zend_Validate_File_MimeType::_throw() |
---|
string
string
false
_throw(string $file, string $errorType) : false
string
string
false
$_defaultTranslator : \Zend_Translate
$_errors : array
array()
deprecated | Since 1.5.0 |
---|
$_finfo : resource
$_finfoError : array
$_headerCheck : boolean
false
$_magicFiles : array
array('/usr/share/misc/magic', '/usr/share/misc/magic.mime', '/usr/share/misc/magic.mgc', '/usr/share/mime/magic', '/usr/share/mime/magic.mime', '/usr/share/mime/magic.mgc', '/usr/share/file/magic', '/usr/share/file/magic.mime', '/usr/share/file/magic.mgc')
$_magicfile : string | null
$_mimetype : string | null
If null, there is no mimetype
$_obscureValue : boolean
false
$_translator : \Zend_Translate
$_translatorDisabled : Boolean
false
$_tryCommonMagicFiles : boolean
true
$_type : string
$_value : mixed
FALSE_TYPE = 'fileIsImageFalseType'
const | string Error constants |
---|---|
inherited_from | \Zend_Validate_File_MimeType::FALSE_TYPE |
FALSE_TYPE = 'fileMimeTypeFalse'
const | Error type constants |
---|
NOT_DETECTED = 'fileIsImageNotDetected'
inherited_from | \Zend_Validate_File_MimeType::NOT_DETECTED |
---|
NOT_DETECTED = 'fileMimeTypeNotDetected'
NOT_READABLE = 'fileIsImageNotReadable'
inherited_from | \Zend_Validate_File_MimeType::NOT_READABLE |
---|
NOT_READABLE = 'fileMimeTypeNotReadable'