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.

array
$_invalidIp= 'array(
'0' => '0.0.0.0/8''
array(
'0' => '0.0.0.0/8'
Details
array
$_messageTemplates= 'array(
self::INVALID => "Invalid type given. String expected"'
array(
self::INVALID => "Invalid type given. String expected"
Details
array
$_messageVariables= 'array(
'hostname' => '_hostname''
array(
'hostname' => '_hostname'
Details
__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
Name | Type | Description |
---|---|---|
$options | array|\Zend_Config | OPTIONAL |

_isReserved(
string $host
)
:
boolean
Returns if the given host is reserved
Name | Type | Description |
---|---|---|
$host | string |
Type | Description |
---|---|
boolean |

_toIp(
string $binary
)
:
mixed
Converts a binary string to an IP address
Name | Type | Description |
---|---|---|
$binary | string |
Type | Description |
---|---|
mixed |

_validateHostnamePart(
)
:
boolean
Internal method to validate the hostname part of the email address
Type | Description |
---|---|
boolean |

_validateLocalPart(
)
:
boolean
Internal method to validate the local part of the email address
Type | Description |
---|---|
boolean |

_validateMXRecords(
)
:
boolean
Internal method to validate the servers MX records
Type | Description |
---|---|
boolean |

getHostnameValidator(
)
:
\Zend_Validate_Hostname
Returns the set hostname validator
Type | Description |
---|---|
\Zend_Validate_Hostname |

isValid(
string $value
)
:
boolean
Defined by Zend_Validate_Interface
Returns true if and only if $value is a valid email address according to RFC2822
Name | Type | Description |
---|---|---|
$value | string |
Type | Description |
---|---|
boolean |

setDeepMxCheck(
boolean $deep
)
:
\Zend_Validate_EmailAddress
Set whether we check MX record should be a deep validation
Name | Type | Description |
---|---|---|
$deep | boolean | Set deep to true to perform a deep validation process for MX records |
Type | Description |
---|---|
\Zend_Validate_EmailAddress | Fluid Interface |

setDomainCheck(
boolean $domain
=
true
)
:
\Zend_Validate_EmailAddress
Sets if the domain should also be checked or only the local part of the email address
Name | Type | Description |
---|---|---|
$domain | boolean |
Type | Description |
---|---|
\Zend_Validate_EmailAddress | Fluid Interface |

setHostnameValidator(
\Zend_Validate_Hostname $hostnameValidator
=
null, int $allow
=
Zend_Validate_Hostname::ALLOW_DNS
)
:
void
Name | Type | Description |
---|---|---|
$hostnameValidator | \Zend_Validate_Hostname | OPTIONAL |
$allow | int | OPTIONAL |

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
Name | Type | Description |
---|---|---|
$messageString | string | |
$messageKey | string | OPTIONAL |
Type | Description |
---|---|
\Zend_Validate_Abstract | Provides a fluent interface |
Exception | Description |
---|---|
\Zend_Validate_Exception |

setOptions(
array $options
=
array()
)
:
\Zend_Validate_EmailAddress
Set options for the email validator
Name | Type | Description |
---|---|---|
$options | array |
Type | Description |
---|---|
\Zend_Validate_EmailAddress | fluid interface |

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
Name | Type | Description |
---|---|---|
$mx | boolean | Set allowed to true to validate for MX records, and false to not validate them |
Type | Description |
---|---|
\Zend_Validate_EmailAddress | Fluid Interface |