Moodle  2.2.1
http://www.collinsharper.com
Zend_Validate_EmailAddress Class Reference
Inheritance diagram for Zend_Validate_EmailAddress:
Collaboration diagram for Zend_Validate_EmailAddress:

Public Member Functions

 __construct ($options=array())
 getOptions ()
 setOptions (array $options=array())
 setMessage ($messageString, $messageKey=null)
 getHostnameValidator ()
 setHostnameValidator (Zend_Validate_Hostname $hostnameValidator=null, $allow=Zend_Validate_Hostname::ALLOW_DNS)
 validateMxSupported ()
 getValidateMx ()
 setValidateMx ($mx)
 getDeepMxCheck ()
 setDeepMxCheck ($deep)
 getDomainCheck ()
 setDomainCheck ($domain=true)
 isValid ($value)

Data Fields

const INVALID = 'emailAddressInvalid'
const INVALID_FORMAT = 'emailAddressInvalidFormat'
const INVALID_HOSTNAME = 'emailAddressInvalidHostname'
const INVALID_MX_RECORD = 'emailAddressInvalidMxRecord'
const INVALID_SEGMENT = 'emailAddressInvalidSegment'
const DOT_ATOM = 'emailAddressDotAtom'
const QUOTED_STRING = 'emailAddressQuotedString'
const INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart'
const LENGTH_EXCEEDED = 'emailAddressLengthExceeded'

Protected Attributes

 $_messageTemplates
 $_invalidIp
 $_messageVariables
 $_hostname
 $_localPart
 $_options

Detailed Description

Definition at line 38 of file EmailAddress.php.


Constructor & Destructor Documentation

__construct ( options = array())

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

Parameters:
array | Zend_Config$optionsOPTIONAL
Returns:
void

Definition at line 130 of file EmailAddress.php.

Here is the call graph for this function:


Member Function Documentation

Returns the set deepMxCheck option

Returns:
boolean

Definition at line 294 of file EmailAddress.php.

Returns the set domainCheck option

Returns:
unknown

Definition at line 316 of file EmailAddress.php.

Returns the set hostname validator

Returns:
Zend_Validate_Hostname

Definition at line 227 of file EmailAddress.php.

Returns all set Options

Returns:
array

Definition at line 157 of file EmailAddress.php.

Returns the set validateMx option

Returns:
boolean

Definition at line 265 of file EmailAddress.php.

isValid ( value)

Defined by Zend_Validate_Interface

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

RFC2822 http://www.columbia.edu/kermit/ascii.html US-ASCII characters string $value boolean

Implements Zend_Validate_Interface.

Definition at line 518 of file EmailAddress.php.

Here is the call graph for this function:

setDeepMxCheck ( deep)

Set whether we check MX record should be a deep validation

Parameters:
boolean$deepSet deep to true to perform a deep validation process for MX records
Returns:
Zend_Validate_EmailAddress Fluid Interface

Definition at line 305 of file EmailAddress.php.

Here is the caller graph for this function:

setDomainCheck ( domain = true)

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

Parameters:
boolean$domain
Returns:
Zend_Validate_EmailAddress Fluid Interface

Definition at line 328 of file EmailAddress.php.

Here is the caller graph for this function:

setHostnameValidator ( Zend_Validate_Hostname hostnameValidator = null,
allow = Zend_Validate_Hostname::ALLOW_DNS 
)
Parameters:
Zend_Validate_Hostname$hostnameValidatorOPTIONAL
int$allowOPTIONAL
Returns:
void

Definition at line 237 of file EmailAddress.php.

Here is the caller graph for this function:

setMessage ( messageString,
messageKey = null 
)

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

Parameters:
string$messageString
string$messageKeyOPTIONAL
Returns:
Zend_Validate_Abstract Provides a fluent interface
Exceptions:
Zend_Validate_Exception

Reimplemented from Zend_Validate_Abstract.

Definition at line 206 of file EmailAddress.php.

setOptions ( array options = array())

Set options for the email validator

Parameters:
array$options
Returns:
Zend_Validate_EmailAddress fluid interface

Definition at line 168 of file EmailAddress.php.

Here is the call graph for this function:

Here is the caller graph for this function:

setValidateMx ( mx)

Set whether we check for a valid MX record via DNS

This only applies when DNS hostnames are validated

Parameters:
boolean$mxSet allowed to true to validate for MX records, and false to not validate them
Returns:
Zend_Validate_EmailAddress Fluid Interface

Definition at line 278 of file EmailAddress.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Whether MX checking via getmxrr is supported or not

This currently only works on UNIX systems

Returns:
boolean

Definition at line 255 of file EmailAddress.php.

Here is the caller graph for this function:


Field Documentation

$_hostname [protected]

Definition at line 100 of file EmailAddress.php.

$_invalidIp [protected]
Initial value:
 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'
    )

Definition at line 69 of file EmailAddress.php.

$_localPart [protected]

Definition at line 105 of file EmailAddress.php.

$_messageTemplates [protected]
Initial value:
 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",
    )

Reimplemented from Zend_Validate_Abstract.

Definition at line 53 of file EmailAddress.php.

$_messageVariables [protected]
Initial value:
 array(
        'hostname'  => '_hostname',
        'localPart' => '_localPart'
    )

Reimplemented from Zend_Validate_Abstract.

Definition at line 92 of file EmailAddress.php.

$_options [protected]
Initial value:
 array(
        'mx'       => false,
        'deep'     => false,
        'domain'   => true,
        'allow'    => Zend_Validate_Hostname::ALLOW_DNS,
        'hostname' => null
    )

Internal options array

Definition at line 110 of file EmailAddress.php.

const DOT_ATOM = 'emailAddressDotAtom'

Definition at line 45 of file EmailAddress.php.

const INVALID = 'emailAddressInvalid'

Definition at line 40 of file EmailAddress.php.

const INVALID_FORMAT = 'emailAddressInvalidFormat'

Definition at line 41 of file EmailAddress.php.

const INVALID_HOSTNAME = 'emailAddressInvalidHostname'

Definition at line 42 of file EmailAddress.php.

const INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart'

Definition at line 47 of file EmailAddress.php.

const INVALID_MX_RECORD = 'emailAddressInvalidMxRecord'

Definition at line 43 of file EmailAddress.php.

const INVALID_SEGMENT = 'emailAddressInvalidSegment'

Definition at line 44 of file EmailAddress.php.

const LENGTH_EXCEEDED = 'emailAddressLengthExceeded'

Definition at line 48 of file EmailAddress.php.

const QUOTED_STRING = 'emailAddressQuotedString'

Definition at line 46 of file EmailAddress.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations