Validator for the maximum size of a file up to a max of 2GB
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_Abstract |
__construct(integer|array $options)
If $options is a integer, it will be used as maximum filesize As Array is accepts the following keys: 'min': Minimum filesize 'max': Maximum filesize 'bytestring': Use bytestring or real size for messages
integer
array
Options for the adapter
\Zend_Validate_Exception |
---|
__get(string $property) : mixed
string
\Zend_Validate_Exception |
---|
mixed
getDefaultTranslator() : \Zend_Translate_Adapter | null
\Zend_Translate_Adapter
null
getErrors() : array
deprecated | Since 1.5.0 |
---|
array
getMax(boolean $raw = false
) : integer | string
boolean
Whether or not to force return of the raw value (defaults off)
integer
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
getMin(boolean $raw = false
) : integer | string
boolean
Whether or not to force return of the raw value (defaults off)
integer
string
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 and only if the filesize of $value is at least min and not bigger than max (when max is not null).
string
Real file to check for size
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
setMax(integer $max) : \Zend_Validate_StringLength
integer
The maximum filesize
\Zend_Validate_Exception |
When max is smaller than min |
---|
\Zend_Validate_StringLength
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
setMin(integer $min) : \Zend_Validate_File_Size
integer
The minimum filesize
\Zend_Validate_Exception |
When min is greater than max |
---|
\Zend_Validate_File_Size
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
setUseByteString(boolean $byteString = true
) : integer
boolean
Use bytestring ?
integer
translatorIsDisabled() : boolean
boolean
useByteString() : 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
_error(string $messageKey, string $value = null
) : void
string
string
OPTIONAL
_fromByteString(string $size) : integer
string
integer
_getSize() : integer
integer
_implodeRecursive(array $pieces) : string
array
string
_setSize(integer $size) : \Zend_Validate_File_Size
integer
\Zend_Validate_File_Size
_setValue(mixed $value) : void
mixed
_throw(string $file, string $errorType) : false
string
string
false
_toByteString(integer $size) : string
integer
string
$_defaultTranslator : \Zend_Translate
$_errors : array
array()
deprecated | Since 1.5.0 |
---|
$_max : integer | null
If null, there is no maximum filesize
$_min : integer
$_obscureValue : boolean
false
$_size : integer
$_translator : \Zend_Translate
$_translatorDisabled : Boolean
false
$_useByteString : boolean
true
$_value : mixed
NOT_FOUND = 'fileSizeNotFound'
TOO_BIG = 'fileSizeTooBig'
TOO_SMALL = 'fileSizeTooSmall'