Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Validator for the maximum size of a file up to a max of 2GB
TOO_BIG = 'fileSizeTooBig'
Details TOO_SMALL = 'fileSizeTooSmall'
Details NOT_FOUND = 'fileSizeNotFound'
Detailsinteger|null $_max = ''Maximum filesize
If null, there is no maximum filesize
Detailsarray $_messageTemplates = 'array'
Detailsarray $_messageVariables = 'array'
Detailsinteger $_min = ''Minimum filesize
Detailsinteger $_size = ''Detected size
Detailsboolean $_useByteString = 'true'Use bytestring ?
Details__construct(
integer|array $options
)
:
Sets validator 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
Details_fromByteString(
string $size
)
:
integerReturns the unformatted size
Details_getSize(
)
:
intRetrieve current detected file size
Details_setSize(
int $size
)
:
Zend_Validate_File_SizeSet current size
Details_throw(
string $file, string $errorType
)
:
falseThrows an error of the given type
Details_toByteString(
integer $size
)
:
stringReturns the formatted size
DetailsgetMax(
bool $raw
=
false
)
:
integer|stringReturns the maximum filesize
DetailsgetMin(
bool $raw
=
false
)
:
integer|stringReturns the minimum filesize
DetailsisValid(
string $value, array $file
=
null
)
:
booleanDefined by Zend_Validate_Interface
Returns true if and only if the filesize of $value is at least min and not bigger than max (when max is not null).
DetailssetMax(
integer $max
)
:
Zend_Validate_StringLengthSets the maximum filesize
DetailssetMin(
integer $min
)
:
Zend_Validate_File_SizeSets the minimum filesize
DetailssetUseByteString(
boolean $byteString
=
true
)
:
integerReturns the minimum filesize
DetailsuseByteString(
)
:
booleanWill bytestring be used?
Details