2000.1. Zend\Validator\Hostname
Please note there are two standalone test scripts for testing IDN characters due to problems
with file encoding.
The first is tests/Zend/Validator/HostnameTestStandalone.php which is designed to be run on
the command line.
The second is tests/Zend/Validator/HostnameTestForm.php which is designed to be run via HTML
to allow users to test entering UTF-8 characters in a form.
2000.1.1. Methods
2000.1.1.1. __construct
-
__construct()
Sets validator options
Parameters: |
- integer – OPTIONAL Set what types of hostname to allow (default ALLOW_DNS)
- bool – OPTIONAL Set whether IDN domains are validated (default true)
- bool – OPTIONAL Set whether the TLD element of a hostname is validated (default true)
- Ip – OPTIONAL
|
:see :
2000.1.1.2. getIpValidator
-
getIpValidator()
Returns the set ip validator
2000.1.1.3. setIpValidator
-
setIpValidator()
@param Ip $ipValidator OPTIONAL
2000.1.1.4. getAllow
-
getAllow()
Returns the allow option
2000.1.1.5. setAllow
-
setAllow()
Sets the allow option
Parameters: | integer – |
Return type: | Hostname Provides a fluent interface |
2000.1.1.6. getIdnCheck
-
getIdnCheck()
Returns the set idn option
2000.1.1.7. useIdnCheck
-
useIdnCheck()
Set whether IDN domains are validated
This only applies when DNS hostnames are validated
Parameters: | bool – Set to true to validate IDN domains |
Return type: | Hostname |
2000.1.1.8. getTldCheck
-
getTldCheck()
Returns the set tld option
2000.1.1.9. useTldCheck
-
useTldCheck()
Set whether the TLD element of a hostname is validated
This only applies when DNS hostnames are validated
Parameters: | bool – Set to true to validate TLD elements |
Return type: | Hostname |
2000.1.1.10. isValid
-
isValid()
Defined by Interface
Returns true if and only if the $value is a valid hostname with respect to the current allow option
Parameters: | string – |
Return type: | bool |
2000.1.1.11. decodePunycode
-
decodePunycode()
Decodes a punycode encoded string to it’s original utf8 string
In case of a decoding failure the original string is returned
Parameters: | string – Punycode encoded string to decode |
Return type: | string |
2000.1.2. Constants
2000.1.2.1. CANNOT_DECODE_PUNYCODE
2000.1.2.2. INVALID
2000.1.2.3. INVALID_DASH
2000.1.2.4. INVALID_HOSTNAME
2000.1.2.5. INVALID_HOSTNAME_SCHEMA
2000.1.2.6. INVALID_LOCAL_NAME
2000.1.2.7. INVALID_URI
2000.1.2.8. IP_ADDRESS_NOT_ALLOWED
2000.1.2.9. LOCAL_NAME_NOT_ALLOWED
2000.1.2.10. UNDECIPHERABLE_TLD
2000.1.2.11. UNKNOWN_TLD
2000.1.2.12. ALLOW_DNS
@var array
2000.1.2.13. ALLOW_IP
2000.1.2.14. ALLOW_LOCAL
2000.1.2.15. ALLOW_URI
2000.1.2.16. ALLOW_ALL