bonvga/geoip2 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  1. Add the Geoip2Bundle to your dependencies:

    // composer.json
    
    {
       // ...
       "require": {
           // ...
           "bonvga/geoip2": "1.*"
       }
    }
    
  2. Use Composer to download and install the Geoip2Bundle:

    $ php composer.phar update bonvga/geoip2
    
  3. Register the bundle in your application:

    // app/AppKernel.php
    
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Bonvga\Bundle\Geoip2Bundle\Geoip2Bundle()
        );
    }
    
  4. 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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL
  • 更新时间: 2015-09-14