Using PHP classes to navigate distributed whois databases - Overview of Whois2.php (
Page 4 of 7 )
This package is a lot different from it's precursor whois.php3, which
was a single class that had to be tweaked and hacked everytime something
changed. Whois2.php is designed in a way that if one registrar somewhere
changes their output format (something NetSol does often enough), the
entire class won't break.
When all is said and done, we can use this class to do whois lookups
for 121 TLDs, including the gTLD's .com/.net/.org/.edu/.int/.mil,
the ccTLD's like .ca, .il, .at etc., Nominet's 2LD domains uk.com,
gb.com and gb.net, and the ORSC (Open Root Server Consortium) alternate
staging roots (.web, .info, .shop, etc).
At the very least we can get back simple output from the whois server itself
in raw, unparsed form. In better cases we have extended methods to further
process the raw result into nice key/value pairs, and in the case of
domains registered in .com/.net/.org we can seperate parsed results into
both those of the registry server response and then the corresponding
registrar's server output, provided we have the methods available to
parse it.
If the methods do not exist to further process data, the class returns
what it has. If you want to create your own extended class to provide
methods to parse the raw output of a given TLD, it's very simple
to add it to the mix.