Class Client
This class provides a client API for all the GeoIP2 Precision web services. The services are Country, City, and Insights. Each service returns a different set of data about an IP address, with Country returning the least data and Insights the most.
Each web service is represented by a different model class, and these model classes in turn contain multiple record classes. The record classes have attributes which contain data about the IP address.
If the web service does not return a particular piece of data for an IP address, the associated attribute is not populated.
The web service may not return any information for an entire record, in which case all of the attributes for that record class will be empty.
Usage
The basic API for this class is the same for all of the web service end
points. First you create a web service object with your MaxMind $userId
and $licenseKey
, then you call the method corresponding to a specific end
point, passing it the IP address you want to look up.
If the request succeeds, the method call will return a model class for the service you called. This model in turn contains multiple record classes, each of which represents part of the data returned by the web service.
If the request fails, the client class throws an exception.
- GeoIp2\WebService\Client implements GeoIp2\ProviderInterface
public
|
#
__construct( integer $userId, string $licenseKey, array $locales = ['en'], array $options = [] )
Constructor. |
public
|
|
public
|
|
public
|
string |
VERSION
|
#
'v2.6.0'
|