1.0.0 2023-08-01 15:17 UTC

This package is auto-updated.

Last update: 2024-09-09 12:30:31 UTC


README

Minimum PHP Version

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

到您需要的地方。