大网数据广告活动
PHP 语言与运行手册

EventDnsBase::__construct · Constructs EventDnsBase object

· 52CE 我爱测

EventDnsBase::__construct — Constructs EventDnsBase object

EventDnsBase::__construct

(PECL event >= 1.2.6-beta)

EventDnsBase::__construct — Constructs EventDnsBase object

Description

public function EventDnsBase::__construct( EventBase $base , int|bool $initialize )

Constructs EventDnsBase object.

Parameters

base

Event base.

initialize

If initialize is true, it attempts to use the underlying operating system defaults to configure the DNS base sensibly. If it is false, the DNS base is left unconfigured, with no nameservers or options set. In the latter case the DNS base should be configured manually, e.g. with EventDnsBase::parseResolvConf().

If initialize is an integer, it must be one of the following flags:

Flag Description
EventDnsBase::DISABLE_WHEN_INACTIVE Do not prevent the libevent event loop from exiting when we have no active DNS requests.
EventDnsBase::INITIALIZE_NAMESERVERS Process the resolv.conf.
EventDnsBase::NAMESERVERS_NO_DEFAULT Do not add default nameserver if there are no nameservers in the resolv.conf.

Errors/Exceptions

If initialize has a type other than int|bool, a TypeError is thrown.

If the value of initialize is invalid, a EventException is thrown.

Changelog

Version Description
PECL event 3.1.3 If initialize has a type other than int|bool, a TypeError is thrown.
PECL event 3.1.0RC1 The type of the initialize parameter has been changed from bool to mixed. The value can be either bool (preserving the previous meaning) or one of the following constants: EventDnsBase::DISABLE_WHEN_INACTIVE, EventDnsBase::INITIALIZE_NAMESERVERS, or EventDnsBase::NAMESERVERS_NO_DEFAULT.

来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
PHP Documentation Group
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。