Validate/Hostname.php

Show: PublicProtectedPrivateinherited
Table of Contents
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.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Validate  
Version
$Id$  

\Zend_Validate_Hostname

Package: Zend_Validate
Please note there are two standalone test scripts for testing IDN characters due to problems with file encoding.
The first is tests/Zend/Validate/HostnameTestStandalone.php which is designed to be run on the command line. The second is tests/Zend/Validate/HostnameTestForm.php which is designed to be run via HTML to allow users to test entering UTF-8 characters in a form.
Parent(s)
\Zend_Validate_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  CANNOT_DECODE_PUNYCODE = 'hostnameCannotDecodePunycode'
>VConstant  INVALID = 'hostnameInvalid'
>VConstant  INVALID_DASH = 'hostnameDashCharacter'
>VConstant  INVALID_HOSTNAME = 'hostnameInvalidHostname'
>VConstant  INVALID_HOSTNAME_SCHEMA = 'hostnameInvalidHostnameSchema'
>VConstant  INVALID_LOCAL_NAME = 'hostnameInvalidLocalName'
>VConstant  INVALID_URI = 'hostnameInvalidUri'
>VConstant  IP_ADDRESS_NOT_ALLOWED = 'hostnameIpAddressNotAllowed'
>VConstant  LOCAL_NAME_NOT_ALLOWED = 'hostnameLocalNameNotAllowed'
>VConstant  UNDECIPHERABLE_TLD = 'hostnameUndecipherableTld'
>VConstant  UNKNOWN_TLD = 'hostnameUnknownTld'
>VConstant  ALLOW_DNS = 1
Allows Internet domain names (e.g., example.com)
>VConstant  ALLOW_IP = 2
Allows IP addresses
>VConstant  ALLOW_LOCAL = 4
Allows local network names (e.g., localhost, www.localdomain)
>VConstant  ALLOW_URI = 8
Allows all types of hostnames
>VConstant  ALLOW_ALL = 15
Allows all types of hostnames

Properties

Methods

methodpublic__construct( $options = array()) : void

Sets validator options

Parameters
NameTypeDescription
$options
Details
See
Technical Specifications for ccTLDs  
methodpublicgetAllow() : integer

Returns the allow option

Returns
TypeDescription
integer
methodpublicgetIpValidator() : \Zend_Validate_Ip

Returns the set ip validator

Returns
TypeDescription
\Zend_Validate_Ip
methodpublicgetOptions() : array

Returns all set options

Returns
TypeDescription
array
methodpublicgetValidateIdn() : boolean

Returns the set idn option

Returns
TypeDescription
boolean
methodpublicgetValidateTld() : boolean

Returns the set tld option

Returns
TypeDescription
boolean
methodpublicisValid(string $value) : boolean

Defined by Zend_Validate_Interface

Returns true if and only if the $value is a valid hostname with respect to the current allow option
Parameters
NameTypeDescription
$valuestring
Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Validate_Exceptionif a fatal error occurs for validation process
methodpublicsetAllow(integer $allow) : \Zend_Validate_Hostname

Sets the allow option

Parameters
NameTypeDescription
$allowinteger
Returns
TypeDescription
\Zend_Validate_HostnameProvides a fluent interface
methodpublicsetIpValidator(\Zend_Validate_Ip $ipValidator = null) : \void;

Parameters
NameTypeDescription
$ipValidator\Zend_Validate_Ip

OPTIONAL

Returns
TypeDescription
\void;
methodpublicsetOptions(array $options) : \Zend_Validate_Hostname

Sets the options for this validator

Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Validate_Hostname
methodpublicsetValidateIdn(boolean $allowed) : void

Set whether IDN domains are validated

This only applies when DNS hostnames are validated
Parameters
NameTypeDescription
$allowedboolean

Set allowed to true to validate IDNs, and false to not validate them

methodpublicsetValidateTld(boolean $allowed) : void

Set whether the TLD element of a hostname is validated

This only applies when DNS hostnames are validated
Parameters
NameTypeDescription
$allowedboolean

Set allowed to true to validate TLDs, and false to not validate them

Documentation was generated by phpDocumentor 2.2.0 .