1

I am working on a API Slim 2 project and I'd like to integrate MaxMind's GeoIP2. I have used composer to install dependencies however it seems I cannot run a GeoIP country lookup for the existing IP entries from the mysql database. If I run script separately ( no Slim 2 ) everything works as expected.

Essentially the API returns json output: IPv4/IPv6 and type of address (ipv4 or ipv6 ). Ideally I want to add GeoIP location information. The output format currently:

    {
        "sourceip": "104.16.58.21",
        "type": "ipv4"
    },
    {
        "sourceip": "159.0.13.131",
        "type": "ipv4"
    }

Code samples: http://pastebin.com/heMyyKdw

Has anyone integrated SLIM 2 with Maxmind GeoIP2?

olibiaz
  • 2,551
  • 4
  • 29
  • 31

0 Answers0