DnsMock
in package
Tags
Table of Contents
- $dnsTypes : mixed
- $hosts : mixed
- checkdnsrr() : mixed
- dns_get_record() : mixed
- gethostbyaddr() : mixed
- gethostbyname() : mixed
- gethostbynamel() : mixed
- getmxrr() : mixed
- register() : mixed
- withMockedHosts() : mixed
- Configures the mock values for DNS queries.
Properties
$dnsTypes
private
static mixed
$dnsTypes
= ['A' => \DNS_A, 'MX' => \DNS_MX, 'NS' => \DNS_NS, 'SOA' => \DNS_SOA, 'PTR' => \DNS_PTR, 'CNAME' => \DNS_CNAME, 'AAAA' => \DNS_AAAA, 'A6' => \DNS_A6, 'SRV' => \DNS_SRV, 'NAPTR' => \DNS_NAPTR, 'TXT' => \DNS_TXT, 'HINFO' => \DNS_HINFO]
$hosts
private
static mixed
$hosts
= []
Methods
checkdnsrr()
public
static checkdnsrr(mixed $hostname[, mixed $type = 'MX' ]) : mixed
Parameters
- $hostname : mixed
- $type : mixed = 'MX'
Return values
mixed —dns_get_record()
public
static dns_get_record(mixed $hostname[, mixed $type = DNS_ANY ][, mixed &$authns = null ][, mixed &$addtl = null ][, mixed $raw = false ]) : mixed
Parameters
- $hostname : mixed
- $type : mixed = DNS_ANY
- $authns : mixed = null
- $addtl : mixed = null
- $raw : mixed = false
Return values
mixed —gethostbyaddr()
public
static gethostbyaddr(mixed $ipAddress) : mixed
Parameters
- $ipAddress : mixed
Return values
mixed —gethostbyname()
public
static gethostbyname(mixed $hostname) : mixed
Parameters
- $hostname : mixed
Return values
mixed —gethostbynamel()
public
static gethostbynamel(mixed $hostname) : mixed
Parameters
- $hostname : mixed
Return values
mixed —getmxrr()
public
static getmxrr(mixed $hostname, mixed &$mxhosts[, mixed &$weight = null ]) : mixed
Parameters
- $hostname : mixed
- $mxhosts : mixed
- $weight : mixed = null
Return values
mixed —register()
public
static register(mixed $class) : mixed
Parameters
- $class : mixed
Return values
mixed —withMockedHosts()
Configures the mock values for DNS queries.
public
static withMockedHosts(array<string|int, mixed> $hosts) : mixed
Parameters
- $hosts : array<string|int, mixed>
-
Mocked hosts as keys, arrays of DNS records as returned by dns_get_record() as values