略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: EventDnsBase

2024-11-14

The EventDnsBase class

(PECL event >= 1.2.6-beta)

简介

Represents Libevent's DNS base structure. Used to resolve DNS asyncronously, parse configuration files like resolv.conf etc.

类摘要

final class EventDnsBase {
/* Constants */
const int OPTION_SEARCH = 1;
const int OPTION_NAMESERVERS = 2;
const int OPTION_MISC = 4;
const int OPTION_HOSTSFILE = 8;
const int OPTIONS_ALL = 15;
/* 方法 */
public addNameserverIp( string $ip ): bool
public addSearch( string $domain ): void
public clearSearch(): void
public __construct( EventBase $base , bool $initialize )
public countNameservers(): int
public loadHosts( string $hosts ): bool
public parseResolvConf( int $flags , string $filename ): bool
public setOption( string $option , string $value ): bool
public setSearchNdots( int $ndots ): bool
}

预定义常量

Tells to read the domain and search fields from the resolv.conf file and the ndots option, and use them to decide which domains(if any) to search for hostnames that aren’t fully-qualified.

EventDnsBase::OPTION_NAMESERVERS

Tells to learn the nameservers from the resolv.conf file.

EventDnsBase::OPTION_MISC

EventDnsBase::OPTION_HOSTSFILE

Tells to read a list of hosts from /etc/hosts as part of loading the resolv.conf file.

EventDnsBase::OPTIONS_ALL

Tells to learn as much as it can from the resolv.conf file.

目录

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/class.eventdnsbase.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3