bonvga/geoip2
最新稳定版本:1.1
Composer 安装命令:
composer require bonvga/geoip2
包简介
Maxmind GeoIP 2 toolkit for Symfony 2
README 文档
README
This Symfony 2 bundle is a helper for Maxmind Geocity2 database installation.
Requirements
You need the Curl binary package. (https://curl.haxx.se/)
Installation
-
Add the Geoip2Bundle to your dependencies:
// composer.json { // ... "require": { // ... "bonvga/geoip2": "1.*" } } -
Use Composer to download and install the Geoip2Bundle:
$ php composer.phar update bonvga/geoip2 -
Register the bundle in your application:
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Bonvga\Bundle\Geoip2Bundle\Geoip2Bundle() ); } -
Optional, updating Maxmind Geocity2 database during composer
// composer.json "scripts": { "post-install-cmd": [ "Bonvga\\Bundle\\Geoip2Bundle\\Composer\\ScriptHandler::installDatabase" ], "post-update-cmd": [ "Bonvga\\Bundle\\Geoip2Bundle\\Composer\\ScriptHandler::installDatabase" ] }, // or with command $ php app/console bonvga:geoip2_database_update
Usage
With the geoip2/geoip2 bundle :
// composer requirement
"geoip2/geoip2": "~2.0"
Or see https://packagist.org/packages/geoip2/geoip2
// PHP sample
use Bonvga\Bundle\Geoip2Bundle\Lib\Geoip2Manager;
use GeoIp2\Database\Reader;
$reader = new Reader(Geoip2Manager::getGeoip2LiteCityDatabasePath());
统计信息
- 总下载量: 25.04k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL
- 更新时间: 2015-09-14