Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes

Zend_Validate_File_Hash Class Reference

Inheritance diagram for Zend_Validate_File_Hash:
Zend_Validate_Abstract Zend_Validate_Interface Zend_Validate_File_Crc32 Zend_Validate_File_Md5 Zend_Validate_File_Sha1

Public Member Functions

 __construct ($options)
 getHash ()
 setHash ($options)
 addHash ($options)
 isValid ($value, $file=null)

Data Fields

const DOES_NOT_MATCH = 'fileHashDoesNotMatch'
const NOT_DETECTED = 'fileHashHashNotDetected'
const NOT_FOUND = 'fileHashNotFound'

Protected Member Functions

 _throw ($file, $errorType)

Protected Attributes

 $_messageTemplates
 $_hash

Detailed Description

Definition at line 35 of file Hash.php.


Constructor & Destructor Documentation

__construct ( options )

Sets validator options

Parameters:
string | array$options
Returns:
void

Reimplemented in Zend_Validate_File_Crc32, Zend_Validate_File_Md5, and Zend_Validate_File_Sha1.

Definition at line 66 of file Hash.php.


Member Function Documentation

_throw ( file,
errorType 
) [protected]

Throws an error of the given type

Parameters:
string$file
string$errorType
Returns:
false

Definition at line 187 of file Hash.php.

addHash ( options )

Adds the hash for one or multiple files

Parameters:
string | array$options
Returns:
Zend_Validate_File_Hash Provides a fluent interface

Reimplemented in Zend_Validate_File_Crc32, Zend_Validate_File_Md5, and Zend_Validate_File_Sha1.

Definition at line 116 of file Hash.php.

getHash (  )

Returns the set hash values as array, the hash as key and the algorithm the value

Returns:
array

Definition at line 91 of file Hash.php.

isValid ( value,
file = null 
)

Defined by Zend_Validate_Interface

Returns true if and only if the given file confirms the set hash

Parameters:
string$valueFilename to check for hash
array$fileFile data from Zend_File_Transfer
Returns:
boolean

Reimplemented in Zend_Validate_File_Crc32, Zend_Validate_File_Md5, and Zend_Validate_File_Sha1.

Definition at line 154 of file Hash.php.

setHash ( options )

Sets the hash for one or multiple files

Parameters:
string | array$options
Returns:
Zend_Validate_File_Hash Provides a fluent interface

Reimplemented in Zend_Validate_File_Crc32, Zend_Validate_File_Md5, and Zend_Validate_File_Sha1.

Definition at line 102 of file Hash.php.


Field Documentation

$_messageTemplates [protected]
Initial value:
 array(
        self::DOES_NOT_MATCH => "The file '%value%' does not match the given hashes",
        self::NOT_DETECTED   => "There was no hash detected for the given file",
        self::NOT_FOUND      => "The file '%value%' could not be found"
    )

Reimplemented from Zend_Validate_Abstract.

Definition at line 47 of file Hash.php.

const DOES_NOT_MATCH = 'fileHashDoesNotMatch'

string Error constants

Reimplemented in Zend_Validate_File_Crc32, Zend_Validate_File_Md5, and Zend_Validate_File_Sha1.

Definition at line 40 of file Hash.php.


The documentation for this class was generated from the following file: