valantic-spryker-eco / geoip2-api
GeoIP2 API Spryker implementation
1.0.0
2023-08-01 15:17 UTC
Requires
- php: >=7.3
- geoip2/geoip2: ~2.0
- spryker/kernel: ^3.56.0
- spryker/log: ^3.7.0
- spryker/symfony: ^3.5.0
- spryker/transfer: ^3.25.0
Requires (Dev)
- codeception/module-asserts: ^1.3.0
- codeception/stub: ^3.6.1
- phpstan/phpstan: ^1.0.0
- spryker/code-sniffer: ^0.17.1
- spryker/testify: ^3.40.0
This package is auto-updated.
Last update: 2024-11-09 12:53:52 UTC
README
MaxMind GeoIP2 API Spryker implementation
A client layer abstraction to use MaxMind GeoIP2 API. Refer to https://www.maxmind.com/ for documentation of the API.
Install package
composer req valantic-spryker-eco/geoip2-api
Update your shared config
$config[GeoIp2Constants::GEO_IP_2_ACCOUNT_ID] = '<your-account-id>';
$config[GeoIp2Constants::GEO_IP_2_LICENSE_KEY] = '<your-license-key>';
If you want to modify your locales or options (especially if you want to use GeoLite2), also add
$config[GeoIp2Constants::GEO_IP_2_LOCALES] = ['en'];
$config[GeoIp2Constants::GEO_IP_2_OPTIONS] = [
'host' => 'geolite.info',
];
Usage
Inject
\ValanticSpryker\Client\GeoIp2\GeoIp2Client
where you need it.