Class Zend_Validate_EmailAddress

Description
  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Validate/EmailAddress.php (line 38)

Zend_Validate_Abstract
   |
   --Zend_Validate_EmailAddress
Class Constant Summary
 DOT_ATOM = 'emailAddressDotAtom'
 INVALID = 'emailAddressInvalid'
 INVALID_FORMAT = 'emailAddressInvalidFormat'
 INVALID_HOSTNAME = 'emailAddressInvalidHostname'
 INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart'
 INVALID_MX_RECORD = 'emailAddressInvalidMxRecord'
 INVALID_SEGMENT = 'emailAddressInvalidSegment'
 LENGTH_EXCEEDED = 'emailAddressLengthExceeded'
 QUOTED_STRING = 'emailAddressQuotedString'
Variable Summary
Method Summary
 void __construct ([array|Zend_Config $options = array()])
 boolean getDeepMxCheck ()
 unknown getDomainCheck ()
 array getOptions ()
 boolean getValidateMx ()
 boolean isValid (string $value)
 Zend_Validate_EmailAddress setDomainCheck ([boolean $domain = true])
 void setHostnameValidator ([Zend_Validate_Hostname $hostnameValidator = null], [int $allow = Zend_Validate_Hostname::ALLOW_DNS])
 Zend_Validate_Abstract setMessage (string $messageString, [string $messageKey = null])
 Zend_Validate_EmailAddress setOptions ([ $options = array()])
 boolean validateMxSupported ()
Variables
string $_hostname (line 100)
  • access: protected
array $_invalidIp = array(
'0' => '0.0.0.0/8',
'10' => '10.0.0.0/8',
'127' => '127.0.0.0/8',
'128' => '128.0.0.0/16',
'169' => '169.254.0.0/16',
'172' => '172.16.0.0/12',
'191' => '191.255.0.0/16',
'192' => array(
'192.0.0.0/24',
'192.0.2.0/24',
'192.88.99.0/24',
'192.168.0.0/16'
),'198'=>'198.18.0.0/15','223'=>'223.255.255.0/24','224'=>'224.0.0.0/4','240'=>'240.0.0.0/4')
(line 69)
string $_localPart (line 105)
  • access: protected
array $_messageTemplates = array(
self::INVALID => "Invalid type given, value should be a string",
self::INVALID_FORMAT => "'%value%' is no valid email address in the basic format local-part@hostname",
self::INVALID_HOSTNAME => "'%hostname%' is no valid hostname for email address '%value%'",
self::INVALID_MX_RECORD => "'%hostname%' does not appear to have a valid MX record for the email address '%value%'",
self::INVALID_SEGMENT => "'%hostname%' is not in a routable network segment. The email address '%value%' should not be resolved from public network.",
self::DOT_ATOM => "'%localPart%' can not be matched against dot-atom format",
self::QUOTED_STRING => "'%localPart%' can not be matched against quoted-string format",
self::INVALID_LOCAL_PART => "'%localPart%' is no valid local part for email address '%value%'",
self::LENGTH_EXCEEDED => "'%value%' exceeds the allowed length",
)
(line 53)
  • access: protected

Redefinition of:
Zend_Validate_Abstract::$_messageTemplates
Validation failure message template definitions
array $_messageVariables = array(
'hostname' => '_hostname',
'localPart' => '_localPart'
)
(line 92)
  • access: protected

Redefinition of:
Zend_Validate_Abstract::$_messageVariables
Additional variables available for validation failure messages
mixed $_options = array(
'mx' => false,
'deep' => false,
'domain' => true,
'allow' => Zend_Validate_Hostname::ALLOW_DNS,
'hostname' => null
)
(line 110)

Internal options array

  • access: protected

Inherited Variables

Inherited from Zend_Validate_Abstract

Zend_Validate_Abstract::$_defaultTranslator
Zend_Validate_Abstract::$_errors
Zend_Validate_Abstract::$_messageLength
Zend_Validate_Abstract::$_messages
Zend_Validate_Abstract::$_obscureValue
Zend_Validate_Abstract::$_translator
Zend_Validate_Abstract::$_translatorDisabled
Zend_Validate_Abstract::$_value
Methods
Constructor __construct (line 130)

Instantiates hostname validator for local use

The following option keys are supported: 'hostname' => A hostname validator, see Zend_Validate_Hostname 'allow' => Options for the hostname validator, see Zend_Validate_Hostname::ALLOW_* 'mx' => If MX check should be enabled, boolean 'deep' => If a deep MX check should be done, boolean

  • access: public
void __construct ([array|Zend_Config $options = array()])
getDeepMxCheck (line 294)

Returns the set deepMxCheck option

  • access: public
boolean getDeepMxCheck ()
getDomainCheck (line 316)

Returns the set domainCheck option

  • access: public
unknown getDomainCheck ()
getHostnameValidator (line 227)

Returns the set hostname validator

  • access: public
Zend_Validate_Hostname getHostnameValidator ()
getOptions (line 157)

Returns all set Options

  • access: public
array getOptions ()
getValidateMx (line 265)

Returns the set validateMx option

  • access: public
boolean getValidateMx ()
isValid (line 518)

Defined by Zend_Validate_Interface

Returns true if and only if $value is a valid email address according to RFC2822

boolean isValid (string $value)
  • string $value
setDeepMxCheck (line 305)

Set whether we check MX record should be a deep validation

  • return: Fluid Interface
  • access: public
Zend_Validate_EmailAddress setDeepMxCheck (boolean $deep)
  • boolean $deep: Set deep to true to perform a deep validation process for MX records
setDomainCheck (line 328)

Sets if the domain should also be checked or only the local part of the email address

  • return: Fluid Interface
  • access: public
Zend_Validate_EmailAddress setDomainCheck ([boolean $domain = true])
  • boolean $domain
setHostnameValidator (line 237)
  • access: public
void setHostnameValidator ([Zend_Validate_Hostname $hostnameValidator = null], [int $allow = Zend_Validate_Hostname::ALLOW_DNS])
setMessage (line 206)

Sets the validation failure message template for a particular key Adds the ability to set messages to the attached hostname validator

  • return: Provides a fluent interface
  • throws: Zend_Validate_Exception
  • access: public
Zend_Validate_Abstract setMessage (string $messageString, [string $messageKey = null])
  • string $messageString
  • string $messageKey: OPTIONAL

Redefinition of:
Zend_Validate_Abstract::setMessage()
Sets the validation failure message template for a particular key
setOptions (line 168)

Set options for the email validator

  • return: fluid interface
  • access: public
Zend_Validate_EmailAddress setOptions ([ $options = array()])
  • array $options
setValidateMx (line 278)

Set whether we check for a valid MX record via DNS

This only applies when DNS hostnames are validated

  • return: Fluid Interface
  • access: public
Zend_Validate_EmailAddress setValidateMx (boolean $mx)
  • boolean $mx: Set allowed to true to validate for MX records, and false to not validate them
validateMxSupported (line 255)

Whether MX checking via getmxrr is supported or not

This currently only works on UNIX systems

  • access: public
boolean validateMxSupported ()

Inherited Methods

Inherited From Zend_Validate_Abstract

 Zend_Validate_Abstract::getDefaultTranslator()
 Zend_Validate_Abstract::getErrors()
 Zend_Validate_Abstract::getMessageLength()
 Zend_Validate_Abstract::getMessages()
 Zend_Validate_Abstract::getMessageTemplates()
 Zend_Validate_Abstract::getMessageVariables()
 Zend_Validate_Abstract::getObscureValue()
 Zend_Validate_Abstract::getTranslator()
 Zend_Validate_Abstract::hasDefaultTranslator()
 Zend_Validate_Abstract::hasTranslator()
 Zend_Validate_Abstract::setDefaultTranslator()
 Zend_Validate_Abstract::setDisableTranslator()
 Zend_Validate_Abstract::setMessage()
 Zend_Validate_Abstract::setMessageLength()
 Zend_Validate_Abstract::setMessages()
 Zend_Validate_Abstract::setObscureValue()
 Zend_Validate_Abstract::setTranslator()
 Zend_Validate_Abstract::translatorIsDisabled()
 Zend_Validate_Abstract::_createMessage()
 Zend_Validate_Abstract::_error()
 Zend_Validate_Abstract::_setValue()
 Zend_Validate_Abstract::__get()
Class Constants
DOT_ATOM = 'emailAddressDotAtom' (line 45)
INVALID = 'emailAddressInvalid' (line 40)
INVALID_FORMAT = 'emailAddressInvalidFormat' (line 41)
INVALID_HOSTNAME = 'emailAddressInvalidHostname' (line 42)
INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart' (line 47)
INVALID_MX_RECORD = 'emailAddressInvalidMxRecord' (line 43)
INVALID_SEGMENT = 'emailAddressInvalidSegment' (line 44)
LENGTH_EXCEEDED = 'emailAddressLengthExceeded' (line 48)
QUOTED_STRING = 'emailAddressQuotedString' (line 46)

Documentation generated on Mon, 21 Jun 2010 15:18:54 -0400 by phpDocumentor 1.4.3