Factory
in package
Table of Contents
Methods
- create() : ResolverInterface
- Creates a DNS resolver instance for the given DNS config
- createCached() : ResolverInterface
- Creates a cached DNS resolver instance for the given DNS config and cache
- createExecutor() : CoopExecutor
- createSingleExecutor() : ExecutorInterface
- createTcpExecutor() : TimeoutExecutor
- createUdpExecutor() : TimeoutExecutor
- decorateHostsFileExecutor() : ExecutorInterface
- Tries to load the hosts file and decorates the given executor on success
Methods
create()
Creates a DNS resolver instance for the given DNS config
public
create(Config|string $config[, LoopInterface|null $loop = null ]) : ResolverInterface
As of v1.7.0 it's recommended to pass a Config
object instead of a
single nameserver address. If the given config contains more than one DNS
nameserver, all DNS nameservers will be used in order. The primary DNS
server will always be used first before falling back to the secondary or
tertiary DNS server.
Parameters
- $config : Config|string
-
DNS Config object (recommended) or single nameserver address
- $loop : LoopInterface|null = null
Tags
Return values
ResolverInterfacecreateCached()
Creates a cached DNS resolver instance for the given DNS config and cache
public
createCached(Config|string $config[, LoopInterface|null $loop = null ][, CacheInterface|null $cache = null ]) : ResolverInterface
As of v1.7.0 it's recommended to pass a Config
object instead of a
single nameserver address. If the given config contains more than one DNS
nameserver, all DNS nameservers will be used in order. The primary DNS
server will always be used first before falling back to the secondary or
tertiary DNS server.
Parameters
- $config : Config|string
-
DNS Config object (recommended) or single nameserver address
- $loop : LoopInterface|null = null
- $cache : CacheInterface|null = null
Tags
Return values
ResolverInterfacecreateExecutor()
private
createExecutor(Config|string $nameserver, LoopInterface $loop) : CoopExecutor
Parameters
- $nameserver : Config|string
- $loop : LoopInterface
Tags
Return values
CoopExecutorcreateSingleExecutor()
private
createSingleExecutor(string $nameserver, LoopInterface $loop) : ExecutorInterface
Parameters
- $nameserver : string
- $loop : LoopInterface
Tags
Return values
ExecutorInterfacecreateTcpExecutor()
private
createTcpExecutor(string $nameserver, LoopInterface $loop) : TimeoutExecutor
Parameters
- $nameserver : string
- $loop : LoopInterface
Tags
Return values
TimeoutExecutorcreateUdpExecutor()
private
createUdpExecutor(string $nameserver, LoopInterface $loop) : TimeoutExecutor
Parameters
- $nameserver : string
- $loop : LoopInterface
Tags
Return values
TimeoutExecutordecorateHostsFileExecutor()
Tries to load the hosts file and decorates the given executor on success
private
decorateHostsFileExecutor(ExecutorInterface $executor) : ExecutorInterface
Parameters
- $executor : ExecutorInterface