2017 © Pedro Peláez
 

library max-mind-geo-ip-bundle

Bundle integrating MaxMind GeoIP database into symfony application

image

mente/max-mind-geo-ip-bundle

Bundle integrating MaxMind GeoIP database into symfony application

  • Wednesday, December 6, 2017
  • by mente
  • Repository
  • 2 Watchers
  • 5 Stars
  • 15,491 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 7 Versions
  • 10 % Grown

The README.md

DEPRECATED Use gpslab/geoip instead. It supports modern Symfony and PHP versions and has a better code quality., (*1)

Insomnia MaxGeoIp Bundle

Build Status, (*2)

Installation

This bundle helps you deliver MaxMind GeoIp functionality inside your symfony application. Based on MaxMind library. Installation is same as for other bundles:, (*3)

composer require mente/max-mind-geo-ip-bundle *

Don't forget to add bundle in your application kernel:, (*4)

<?php
    // app/AppKernel.php

    public function registerBundles()
    {
        $bundles = array(
            // ...
            new \Insomnia\MaxMindGeoIpBundle\InsomniaMaxMindGeoIpBundle(),
        );
    }

Configuration is pretty straight forward:, (*5)

insomnia_max_mind_geo_ip:
    #Path to geolite2 database. Default is %kernel.root_dir%/GeoIpCountry.mmdb
    path: %kernel.root_dir%/geolite2.mmdb

After you've finished setting up code, it's time to update the most recent MaxMind database:, (*6)

#If you want to use country-precision
php app/console insomnia:geoip:update http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
#OR
#If you want to use city-precision
#Keep in mind that city-precision database is bigger and it takes a bit longer time to find it by ip.
php app/console http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz

Command will save and unpack database to destination specified in configuration. So you don't need to worry about correct placement., (*7)

Hint: if you want to automate database update, you can integrate it in your composer install/update phase using provided script handler. Add following to yours composer.json:, (*8)

"scripts": {
    "post-install-cmd": [
        "Insomnia\\MaxMindGeoIpBundle\\Composer\\ScriptHandler::downloadMaxMindDB"
    ],
    "post-update-cmd": [
        "Insomnia\\MaxMindGeoIpBundle\\Composer\\ScriptHandler::downloadMaxMindDB"
    ]
},
"extra": {
    "maxmind-db-path": "app/geolite2.mmdb"
}

Extra part maxmind-db-path is required and should be same as insomnia_max_mind_geo_ip.path in symfony configuration. That's it! You're ready to start, (*9)

Usage

Bundle exposes 2 services: insomnia_max_mind_geo_ip and insomnia_max_mind_geo_ip_service. Former is MaxMind pure database reader itself and latter is thin wrapper around it with several useful methods. For complete set of methods check Insomnia\MaxMindGeoIpBundle\Service\GeoIpService, (*10)

The Versions

06/12 2017

dev-master

9999999-dev

Bundle integrating MaxMind GeoIP database into symfony application

  Sources   Download

GPL

The Requires

 

The Development Requires

by Jaume Bosch

geoip symfony maxmind

06/12 2017

0.3.1

0.3.1.0

Bundle integrating MaxMind GeoIP database into symfony application

  Sources   Download

GPL

The Requires

 

The Development Requires

by Jaume Bosch

geoip symfony maxmind

30/10 2017

0.3.0

0.3.0.0

Bundle integrating MaxMind GeoIP database into symfony application

  Sources   Download

GPL

The Requires

 

The Development Requires

by Jaume Bosch

geoip symfony maxmind

23/02 2017

0.2.2

0.2.2.0

Bundle integrating MaxMind GeoIP database into symfony application

  Sources   Download

GPL

The Requires

 

The Development Requires

by Jaume Bosch

geoip symfony maxmind

11/02 2017

0.2.1

0.2.1.0

Bundle integrating MaxMind GeoIP database into symfony application

  Sources   Download

GPL

The Requires

 

The Development Requires

by Jaume Bosch

geoip symfony maxmind

02/08 2016

v0.2.0

0.2.0.0

Bundle integrating MaxMind GeoIP database into symfony application

  Sources   Download

GPL

The Requires

 

The Development Requires

geoip symfony maxmind

29/08 2014

v0.1.0

0.1.0.0

Bundle integrating MaxMind GeoIP database into symfony application

  Sources   Download

GPL

The Requires

 

The Development Requires

geoip symfony maxmind