\Zend_Validate_File_Sha1
Validator for the sha1 hash of given files
- Copyright: Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
- License: http://framework.zend.com/license/new-bsd New BSD License
Synopsis
class Zend_Validate_File_Sha1
extends Zend_Validate_File_Hash
{
- // constants
- const DOES_NOT_MATCH = 'fileSha1DoesNotMatch';
- const NOT_DETECTED = 'fileSha1NotDetected';
- const NOT_FOUND = 'fileSha1NotFound';
- // Inherited constants from Zend_Validate_File_Hash
- const DOES_NOT_MATCH = 'fileHashDoesNotMatch';
- const NOT_DETECTED = 'fileHashHashNotDetected';
- const NOT_FOUND = 'fileHashNotFound';
- // members
- protected array $_messageTemplates = ;
- protected $_hash;
- // Inherited members from Zend_Validate_File_Hash
- protected array $_messageTemplates;
- protected $_hash;
- // Inherited members from Zend_Validate_Abstract
- protected $_value;
- protected array $_messageVariables;
- protected array $_messageTemplates;
- protected array $_messages;
- protected bool $_obscureValue;
- protected array $_errors;
- protected Zend_Translate $_translator;
- protected static Zend_Translate $_defaultTranslator;
- protected Boolean $_translatorDisabled;
- // methods
- public void __construct()
- public array getSha1()
- public Zend_Validate_File_Hash setHash()
- public Zend_Validate_File_Hash setSha1()
- public Zend_Validate_File_Hash addHash()
- public Zend_Validate_File_Hash addSha1()
- public boolean isValid()
- // Inherited methods from Zend_Validate_File_Hash
- public void __construct()
- public array getHash()
- public Zend_Validate_File_Hash setHash()
- public Zend_Validate_File_Hash addHash()
- public boolean isValid()
- protected false _throw()
- // Inherited methods from Zend_Validate_Abstract
- public array getMessages()
- public array getMessageVariables()
- public array getMessageTemplates()
- public Zend_Validate_Abstract setMessage()
- public Zend_Validate_Abstract setMessages()
- public mixed __get()
- protected string _createMessage()
- protected void _error()
- protected void _setValue()
- public array getErrors()
- public Zend_Validate_Abstract setObscureValue()
- public bool getObscureValue()
- public Zend_Validate_Abstract setTranslator()
- public Zend_Translate_Adapter|null getTranslator()
- public static void setDefaultTranslator()
- public static Zend_Translate_Adapter|null getDefaultTranslator()
- public Zend_Validate_Abstract setDisableTranslator()
- public bool translatorIsDisabled()
Hierarchy
Extends
Constants
Name | Value |
---|---|
DOES_NOT_MATCH | 'fileSha1DoesNotMatch' |
NOT_DETECTED | 'fileSha1NotDetected' |
NOT_FOUND | 'fileSha1NotFound' |
DOES_NOT_MATCH | 'fileHashDoesNotMatch' |
NOT_DETECTED | 'fileHashHashNotDetected' |
NOT_FOUND | 'fileHashNotFound' |
Members
protected
- $_defaultTranslator
—
Zend_Translate
Default translation object for all validate objects - $_errors
—
array
Array of validation failure message codes - $_hash
—
string
Hash of the file - $_hash
—
string
Hash of the file - $_messageTemplates — array
- $_messageTemplates — array
- $_messageTemplates
—
array
Validation failure message template definitions - $_messageVariables
—
array
Additional variables available for validation failure messages - $_messages
—
array
Array of validation failure messages - $_obscureValue
—
bool
Flag indidcating whether or not value should be obfuscated in error messages - $_translator
—
Zend_Translate
Translation object - $_translatorDisabled
—
Boolean
Is translation disabled? - $_value
—
mixed
The value to be validated
Methods
public
- __construct() — Sets validator options
- addHash() — Adds the sha1 hash for one or multiple files
- addSha1() — Adds the sha1 hash for one or multiple files
- getSha1() — Returns all set sha1 hashes
- isValid() — Defined by Zend_Validate_Interface
- setHash() — Sets the sha1 hash for one or multiple files
- setSha1() — Sets the sha1 hash for one or multiple files
Inherited from Zend_Validate_File_Hash
protected
- _throw() — Throws an error of the given type
public
- addHash() — Adds the hash for one or multiple files
- getHash() — Returns the set hash values as array, the hash as key and the algorithm the value
- isValid() — Defined by Zend_Validate_Interface
- setHash() — Sets the hash for one or multiple files
Inherited from Zend_Validate_Abstract
protected
- _createMessage() — Constructs and returns a validation failure message with the given message key and value.
- _error()
- _setValue() — Sets the value to be validated and clears the messages and errors arrays
public
- __get() — Magic function returns the value of the requested property, if and only if it is the value or a message variable.
- getDefaultTranslator() — Get default translation object for all validate objects
- getErrors() — Returns array of validation failure message codes
- getMessageTemplates() — Returns the message templates from the validator
- getMessageVariables() — Returns an array of the names of variables that are used in constructing validation failure messages
- getMessages() — Returns array of validation failure messages
- getObscureValue() — Retrieve flag indicating whether or not value should be obfuscated in messages
- getTranslator() — Return translation object
- setDefaultTranslator() — Set default translation object for all validate objects
- setDisableTranslator() — Indicate whether or not translation should be disabled
- setMessage() — Sets the validation failure message template for a particular key
- setMessages() — Sets validation failure message templates given as an array, where the array keys are the message keys, and the array values are the message template strings.
- setObscureValue() — Set flag indicating whether or not value should be obfuscated in messages
- setTranslator() — Set translation object
- translatorIsDisabled() — Is translation disabled?