API Documentation

Validate/EmailAddress.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Validate
version
$Id: EmailAddress.php 22697 2010-07-26 21:14:47Z alexander $
Classes
Zend_Validate_EmailAddress

Description

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.

Zend_Validate_EmailAddress

Extends from
Zend_Validate_Abstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Validate
Constants
INVALID
INVALID_FORMAT
INVALID_HOSTNAME
INVALID_MX_RECORD
INVALID_SEGMENT
DOT_ATOM
QUOTED_STRING
INVALID_LOCAL_PART
LENGTH_EXCEEDED
Properties
$_messageTemplates
$_invalidIp
$_messageVariables
$_hostname
$_localPart
$_options
Methods
__construct
getOptions
setOptions
setMessage
getHostnameValidator
setHostnameValidator
validateMxSupported
getValidateMx
setValidateMx
getDeepMxCheck
setDeepMxCheck
getDomainCheck
setDomainCheck
_isReserved
_toIp
_validateLocalPart
_validateMXRecords
_validateHostnamePart
isValid

Description

Constants

INVALID

 INVALID = 'emailAddressInvalid'

Details

value
emailAddressInvalid

INVALID_FORMAT

 INVALID_FORMAT = 'emailAddressInvalidFormat'

Details

value
emailAddressInvalidFormat

INVALID_HOSTNAME

 INVALID_HOSTNAME = 'emailAddressInvalidHostname'

Details

value
emailAddressInvalidHostname

INVALID_MX_RECORD

 INVALID_MX_RECORD = 'emailAddressInvalidMxRecord'

Details

value
emailAddressInvalidMxRecord

INVALID_SEGMENT

 INVALID_SEGMENT = 'emailAddressInvalidSegment'

Details

value
emailAddressInvalidSegment

DOT_ATOM

 DOT_ATOM = 'emailAddressDotAtom'

Details

value
emailAddressDotAtom

QUOTED_STRING

 QUOTED_STRING = 'emailAddressQuotedString'

Details

value
emailAddressQuotedString

INVALID_LOCAL_PART

 INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart'

Details

value
emailAddressInvalidLocalPart

LENGTH_EXCEEDED

 LENGTH_EXCEEDED = 'emailAddressLengthExceeded'

Details

value
emailAddressLengthExceeded

Properties

$_hostname

string $_hostname = ''

Details

$_hostname
string
visibility
protected
default
final
false
static
false

$_invalidIp

array $_invalidIp = 'array'

Details

$_invalidIp
array
visibility
protected
default
array
final
false
static
false
see
http://en.wikipedia.org/wiki/IPv4

$_localPart

string $_localPart = ''

Details

$_localPart
string
visibility
protected
default
final
false
static
false

$_messageTemplates

array $_messageTemplates = 'array'

Details

$_messageTemplates
array
visibility
protected
default
array
final
false
static
false

$_messageVariables

array $_messageVariables = 'array'

Details

$_messageVariables
array
visibility
protected
default
array
final
false
static
false

$_options

 $_options = 'array'

Internal options array

Details

visibility
protected
default
array
final
false
static
false

Methods

__construct

__construct( array|Zend_Config $options = array ) : void

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

Arguments
$options
arrayZend_Config
OPTIONAL
Details
visibility
public
final
false
static
false

_isReserved

_isReserved( string $host ) : boolean

Returns if the given host is reserved

Arguments
$host
string
Output
boolean
Details
visibility
private
final
false
static
false

_toIp

_toIp( string $binary ) : mixed

Converts a binary string to an IP address

Arguments
$binary
string
Output
mixed
Details
visibility
private
final
false
static
false

_validateHostnamePart

_validateHostnamePart( ) : boolean

Internal method to validate the hostname part of the email address

Output
boolean
Details
visibility
private
final
false
static
false

_validateLocalPart

_validateLocalPart( ) : boolean

Internal method to validate the local part of the email address

Output
boolean
Details
visibility
private
final
false
static
false

_validateMXRecords

_validateMXRecords( ) : boolean

Internal method to validate the servers MX records

Output
boolean
Details
visibility
private
final
false
static
false

getDeepMxCheck

getDeepMxCheck( ) : boolean

Returns the set deepMxCheck option

Output
boolean
Details
visibility
public
final
false
static
false

getDomainCheck

getDomainCheck( ) : unknown

Returns the set domainCheck option

Output
unknown
Details
visibility
public
final
false
static
false

getHostnameValidator

getHostnameValidator( ) : Zend_Validate_Hostname

Returns the set hostname validator

Details
visibility
public
final
false
static
false

getOptions

getOptions( ) : array

Returns all set Options

Output
array
Details
visibility
public
final
false
static
false

getValidateMx

getValidateMx( ) : boolean

Returns the set validateMx option

Output
boolean
Details
visibility
public
final
false
static
false

isValid

isValid( string $value ) : boolean

Defined by Zend_Validate_Interface

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

Arguments
$value
string
Output
boolean
Details
visibility
public
final
false
static
false
link
RFC2822
link
US-ASCII characters

setDeepMxCheck

setDeepMxCheck( boolean $deep ) : Zend_Validate_EmailAddress

Set whether we check MX record should be a deep validation

Arguments
$deep
boolean
Set deep to true to perform a deep validation process for MX records
Output
Zend_Validate_EmailAddress
Fluid Interface
Details
visibility
public
final
false
static
false

setDomainCheck

setDomainCheck( boolean $domain = true ) : Zend_Validate_EmailAddress

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

Arguments
$domain
boolean
Output
Zend_Validate_EmailAddress
Fluid Interface
Details
visibility
public
final
false
static
false

setHostnameValidator

setHostnameValidator( Zend_Validate_Hostname $hostnameValidator = null, int $allow = Zend_Validate_Hostname ) : void

Arguments
$hostnameValidator
Zend_Validate_Hostname
OPTIONAL
$allow
int
OPTIONAL
Details
visibility
public
final
false
static
false

setMessage

setMessage( string $messageString, string $messageKey = null ) : Zend_Validate_Abstract

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

Arguments
$messageString
string
$messageKey
string
OPTIONAL
Output
Zend_Validate_Abstract
Provides a fluent interface
Details
visibility
public
final
false
static
false
throws

setOptions

setOptions( array $options = array ) : Zend_Validate_EmailAddress

Set options for the email validator

Arguments
$options
array
Output
Zend_Validate_EmailAddress
fluid interface
Details
visibility
public
final
false
static
false

setValidateMx

setValidateMx( boolean $mx ) : Zend_Validate_EmailAddress

Set whether we check for a valid MX record via DNS

This only applies when DNS hostnames are validated

Arguments
$mx
boolean
Set allowed to true to validate for MX records, and false to not validate them
Output
Zend_Validate_EmailAddress
Fluid Interface
Details
visibility
public
final
false
static
false

validateMxSupported

validateMxSupported( ) : boolean

Whether MX checking via getmxrr is supported or not

This currently only works on UNIX systems

Output
boolean
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.