- A PHP library to retrieve WHOIS informations
- Retrieving raw WHOIS informations in PHP
- Checking a domain’s availability with PHP
- Y U NO access WHOIS informations in PHP?
This post is part of the ”WHOIS in PHP: consuming the Robowhois API” series; here is a list of all the articles contained this series:
In these days we finalized the last parts of the official
PHP client for the Robowhois API
, and here are the changes for the 0.9.0
version.
Parts and properties API
As part of our job, we needed to implement the last
2 API endpoints provided by Robowhois, properties
and parts
.
Everything is documented in the
README
but you can also follow the examples under the sample/
directory:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Magic objects, behaving like arrays
We implemented the \ArrayObject
interface for the objects
returned by the API, which means that now you can access
the results of an API call just like an array:
1 2 3 4 5 6 |
|
but, for those like us who like the OO synthax, we implemented
some magic to let you retrieve those values via getters, which
are built on-the-fly thanks to PHP’s __call()
method:
1 2 3 |
|
Getters are a camelized version of the array keys, and are built thanks to the Doctrine Inflector.
Mapping the existing API
We renamed the methods accessing the API in order to 100% reflect
the ones exposed by the API, also used in the
Ruby client: so now the
Robowhois\Robowhois
object has:
->account()
->whois()
->whoisProperties()
->whoisParts()
->whoisRecord()
->whoisAvailability()
Simplified exceptions
We initially added tons of exceptions but we eventually
decide to keep the only Robowhois\Exception
class.
Now?
Wanna retrieve WHOIS informations in PHP at a decent price?
Start consuming the Robowhois APIs, with PHP.