Public Member Functions | Data Fields | Protected Attributes

Zend_Validate_File_Sha1 Class Reference

Inheritance diagram for Zend_Validate_File_Sha1:
Zend_Validate_File_Hash Zend_Validate_Abstract Zend_Validate_Interface

Public Member Functions

 __construct ($options)
 getSha1 ()
 setHash ($options)
 setSha1 ($options)
 addHash ($options)
 addSha1 ($options)
 isValid ($value, $file=null)

Data Fields

const DOES_NOT_MATCH = 'fileSha1DoesNotMatch'
const NOT_DETECTED = 'fileSha1NotDetected'
const NOT_FOUND = 'fileSha1NotFound'

Protected Attributes

 $_messageTemplates
 $_hash

Detailed Description

Definition at line 35 of file Sha1.php.


Constructor & Destructor Documentation

__construct ( options )

Sets validator options

$hash is the hash we accept for the file $file

Parameters:
string | array$options
Returns:
void

Reimplemented from Zend_Validate_File_Hash.

Definition at line 68 of file Sha1.php.


Member Function Documentation

addHash ( options )

Adds the sha1 hash for one or multiple files

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

Reimplemented from Zend_Validate_File_Hash.

Definition at line 127 of file Sha1.php.

addSha1 ( options )

Adds the sha1 hash for one or multiple files

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

Definition at line 144 of file Sha1.php.

getSha1 (  )

Returns all set sha1 hashes

Returns:
array

Definition at line 87 of file Sha1.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 from Zend_Validate_File_Hash.

Definition at line 159 of file Sha1.php.

setHash ( options )

Sets the sha1 hash for one or multiple files

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

Reimplemented from Zend_Validate_File_Hash.

Definition at line 98 of file Sha1.php.

setSha1 ( options )

Sets the sha1 hash for one or multiple files

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

Definition at line 115 of file Sha1.php.


Field Documentation

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

Reimplemented from Zend_Validate_File_Hash.

Definition at line 47 of file Sha1.php.

const DOES_NOT_MATCH = 'fileSha1DoesNotMatch'

string Error constants

Reimplemented from Zend_Validate_File_Hash.

Definition at line 40 of file Sha1.php.


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