Download the PHP package davidepastore/ipinfo without Composer
On this page you can find all versions of the php package davidepastore/ipinfo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download davidepastore/ipinfo
More information about davidepastore/ipinfo
Files in davidepastore/ipinfo
Package ipinfo
Short Description A wrapper around the ipinfo.io services
License GPL-2.0+
Informations about the package ipinfo
ipinfo
A wrapper around the ipinfo.io services.
Install
You can install the library using composer:
How to use
Settings
Token
You can set your token when you instantiate the object but it's not mandatory.
cURL options
The cURL options to use while trying to connect when you instantiate the object:
Read details about the given ip
You can read all the properties from the given ip.
Read details about your ip
You can read all the properties from your ip.
Get info from the host
After obtaining the Host
instance you can read all the properties or each of them individually.
Read only a field
There are different constants that you could use to read specific field value from an Ipinfo
instance using the getSpecificField()
and getYourOwnIpSpecificField()
methods:
Read only the Geo data (which is faster)
By using the getIpGeoDetails()
method you will get less fields. This call tends to be faster than getFullIpDetails()
so use this call in case you only need the following fields:
These fields will be empty:
Error Handling
You can handle all the types of IpInfo exceptions by catching the IpInfoExceptionException
:
Invalid Token Exception
It could happen that the token you are using to make the API call is not valid. You can handle it by catching the InvalidTokenException
:
Rate Limit Exceed Exception
It could happen that your API call exceeds the rate limit. You can handle it by catching the RateLimitExceedException
:
Wrong Ip Exception
It could happen that your API call is trying to obtain info about a wrong ip. You can handle it by catching the WrongIpException
:
Issues
If you have issues, just open one here.
All versions of ipinfo with dependencies
ext-curl Version *
ext-json Version *