Download the PHP package divineomega/php-geolocation without Composer
On this page you can find all versions of the php package divineomega/php-geolocation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download divineomega/php-geolocation
More information about divineomega/php-geolocation
Files in divineomega/php-geolocation
Package php-geolocation
Short Description PHP library that determines the country of an IP address
License LGPL-3.0-only
Informations about the package php-geolocation
PHP Geolocation
This package provides a PHP library that determines the country of an IP address.
Installation
You can easily install PHP Geolocation with composer.
Usage
The most simple usage of PHP Geolocation is to create a new Locator object and call its getCountryByIP
method.
Caching
You can configure PHP Geolocation to use any PSR-6 compliant caching library. This is easily done using the setCache
method.
The following example configures a file cache (provided by the cache/filesystem-adapter
package).
Alternative location providers
By default, PHP Geolocation will try to use the operating system's native whois
command to determine the IP address. If you wish you
can use an alternative location provider. This can be done using the setLocationProvider
method, as follows.
To get a free api key sign up at Ip Stack's website.
If you wish to develop your own location provider, simply create a new class that implements the LocationProviderInterface
provided in
this package. See the existing WhoIs
and FreeGeoIP
location provider classes if you need help creating your own location provider.
All versions of php-geolocation with dependencies
divineomega/php-countries Version ^2.1.1
psr/cache Version ^1.0
guzzlehttp/guzzle Version ^6.3|^7.0
ext-json Version *