valantic-spryker-eco / geoip2-api
GeoIP2 API Spryker 实现
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-09-09 12:30:31 UTC
README
MaxMind GeoIP2 API Spryker 实现
MaxMind GeoIP2 API 的客户端层抽象。有关 API 的文档,请参阅https://www.maxmind.com/。
安装包
composer req valantic-spryker-eco/geoip2-api
更新共享配置
$config[GeoIp2Constants::GEO_IP_2_ACCOUNT_ID] = '<your-account-id>';
$config[GeoIp2Constants::GEO_IP_2_LICENSE_KEY] = '<your-license-key>';
如果您想修改您的区域设置或选项(尤其是如果您想使用 GeoLite2),还需要添加
$config[GeoIp2Constants::GEO_IP_2_LOCALES] = ['en'];
$config[GeoIp2Constants::GEO_IP_2_OPTIONS] = [
'host' => 'geolite.info',
];
使用方法
注入
\ValanticSpryker\Client\GeoIp2\GeoIp2Client
到您需要的地方。