- Simplified resolution of domains names and IP addresses
- Does not rely on distributed lists of WHOIS servers, uses IANA/ARIN 'root' server referrals.
- Includes optional, simple, PDO-driven caching functionality to improve response times and mediate load on WHOIS roots.
- Requires only PHP >= 5.4, no external binaries or libraries.
- PHP7 compatible.
All classes take an optional final parameter that is an array containing key => value pairs that can be used to override certain protected properties. Overrideable parameters set in each class' private $overrides
parameter, and are detailed below.
Public Methods:
void __construct(array $params = [])
string query(string $domain)
static string stripComments(string $input, bool $strip_blank = true, string $regex = '/^(?:#|%).*$/')
- Strips comments from WHOIS responses, generally formatted as lines beginning with either
#
or%
. - Second parameter controls stripping of blank lines
- Third parameted allows the comment matching regex to be overridden.
- Strips comments from WHOIS responses, generally formatted as lines beginning with either
Overrideable Parameters:
max_response_size
- The maximum amount of data, in bytes, to accept from a WHOIS response. [Default:20480
]normalize_line_breaks
- If true replaces all instances of\r\n
with\n
. [Default:true
]
Public Methods:
- Public methods inherited from parent class
Whois
. void __construct(\PDO $dbh, array $params = [])
static boolean initDB(\PDO $dbh)
- Issues
CREATE TABLE IF NOT EXISTS
statement to create table, seesrc/CachedWhois.php
.
- Issues
Overrideable Parameters:
cache_lifetime
- Length of time, is seconds, to cache a TLD WHOIS server referral. [Default604800
aka 7 days]
Public Methods:
- Public methods inherited from parent class
Whois
. void __construct(array $params=[])
string function query(string $ipaddr)
static bool validateIP(string $ipaddr)
Overrideable Parameters: None
string query(string $domain)
static string stripComments(string $input, bool $strip_blank = true, string $regex = '/^(?:#|%).*$/')
CachedIPWhois
Class- Make
IPWhois::validate()
check for reserved addresses.