update_hostname_validator.php
Tags
Table of Contents
Constants
- IANA_URL = 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt'
- LAMINAS_HOSTNAME_VALIDATOR_FILE = __DIR__ . '/../src/Hostname.php'
Functions
- getOfficialTLDs() : Response
- Get Official TLDs
- getVersionFromString() : string
- Extract the first match of a string like "Version 2015072300" from the given string
- getNewValidTlds() : array<int, string>
- Extract new Valid TLDs from a string containing one per line.
- getPunycodeDecoder() : callable
- Retrieve and return a punycode decoder.
Constants
IANA_URL
public
mixed
IANA_URL
= 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt'
LAMINAS_HOSTNAME_VALIDATOR_FILE
public
mixed
LAMINAS_HOSTNAME_VALIDATOR_FILE
= __DIR__ . '/../src/Hostname.php'
Functions
getOfficialTLDs()
Get Official TLDs
getOfficialTLDs() : Response
Tags
Return values
ResponsegetVersionFromString()
Extract the first match of a string like "Version 2015072300" from the given string
getVersionFromString(string $prefix, string $string) : string
Parameters
- $prefix : string
- $string : string
Tags
Return values
stringgetNewValidTlds()
Extract new Valid TLDs from a string containing one per line.
getNewValidTlds(string $string) : array<int, string>
Parameters
- $string : string
Return values
array<int, string>getPunycodeDecoder()
Retrieve and return a punycode decoder.
getPunycodeDecoder() : callable
TLDs are puny encoded.
We need a decodePunycode function to translate TLDs to UTF-8:
- use idn_to_utf8 if available
- otherwise, use Hostname::decodePunycode()