2017 © Pedro Peláez
 

library geoip

Fork of MaxMind GeoIP PHP API with improved error handling

image

daigo75/geoip

Fork of MaxMind GeoIP PHP API with improved error handling

  • Friday, October 18, 2013
  • by daigo75
  • Repository
  • 1 Watchers
  • 0 Stars
  • 128 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 300 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

MaxMind GeoIP PHP API

Requirements

This module has no external dependencies. You only need a MaxMind GeoIP database. To download a free GeoIP Standard Country database, please see our GeoLite page., (*1)

Installing with Composer

Define Your Dependencies

We recommend installing this package with Composer. To do this, add geoip/geoip to your composer.json file., (*2)

{
    "require": {
        "daigo75/geoip": "~1.14"
    }
}

Install Composer

Run in your project root:, (*3)

curl -s http://getcomposer.org/installer | php

Install Dependencies

Run in your project root:, (*4)

php composer.phar install

Require Autoloader

You can autoload all dependencies by adding this to your code:, (*5)

require 'vendor/autoload.php';

Installing without Composer

Place the 'geoip.inc' file in the include_path as specified in your php.ini file or place it in the same directory as your PHP scripts., (*6)

Usage

Gets country name by hostname :, (*7)

<?php

require 'vendor/autoload.php';

$gi = geoip_open("/usr/local/share/GeoIP/GeoIP.dat",GEOIP_STANDARD);

echo geoip_country_code_by_addr($gi, "24.24.24.24") . "\t" .
     geoip_country_name_by_addr($gi, "24.24.24.24") . "\n";
echo geoip_country_code_by_addr($gi, "80.24.24.24") . "\t" .
     geoip_country_name_by_addr($gi, "80.24.24.24") . "\n";

geoip_close($gi);

Memory Caching

To enable memory caching, pass GEOIP_SHARED_MEMORY or GEOIP_MEMORY_CACHE as the second argument of geoip_open., (*8)

GEOIP_SHARED_MEMORY requires php >= 4.0.4 compiled with --enable-shmop configure time. See (http://us2.php.net/manual/en/ref.shmop.php). In addition, you should call geoip_load_shared_mem before calling geoip_open. See sample_city.php for an example of shared memory caching., (*9)

Support

For help with this API or our databases, please see [our support page] (http://www.maxmind.com/en/support)., (*10)

This software is Copyright (c) 2013 by MaxMind, Inc., (*11)

This is free software, licensed under the GNU Lesser General Public License version 2.1 or later., (*12)

Thanks

Thanks to Jim Winstead., (*13)

The Versions

18/10 2013

dev-master

9999999-dev http://dev.maxmind.com/geoip/legacy/downloadable

Fork of MaxMind GeoIP PHP API with improved error handling

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind

18/10 2013

v1.24

1.24.0.0 http://dev.maxmind.com/geoip/legacy/downloadable

Fork of MaxMind GeoIP PHP API with improved error handling

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind

16/10 2013

v1.23

1.23.0.0 http://dev.maxmind.com/geoip/legacy/downloadable

Fork of MaxMind GeoIP PHP API with improved error handling

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind

16/10 2013

v1.21

1.21.0.0 http://dev.maxmind.com/geoip/legacy/downloadable

Fork of MaxMind GeoIP PHP API with improved error handling

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind

16/10 2013

v1.20

1.20.0.0 http://dev.maxmind.com/geoip/legacy/downloadable

Fork of MaxMind GeoIP PHP API with improved error handling

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind

03/09 2013

v1.17

1.17.0.0 http://dev.maxmind.com/geoip/legacy/downloadable

Fork of MaxMind GeoIP PHP API with improved error handling

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind

26/07 2013

dev-Compatibility-CoexistenceWithGeoIPExtension

dev-Compatibility-CoexistenceWithGeoIPExtension http://dev.maxmind.com/geoip/legacy/downloadable

Fork of MaxMind GeoIP PHP API with improved error handling

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind

26/07 2013

v1.16

1.16.0.0 http://dev.maxmind.com/geoip/legacy/downloadable

Fork of MaxMind GeoIP PHP API with improved error handling

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind

19/07 2013

1.15

1.15.0.0 http://dev.maxmind.com/geoip/legacy/downloadable

Fork of MaxMind GeoIP PHP API with improved error handling

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind

19/07 2013

v1.18

1.18.0.0 http://dev.maxmind.com/geoip/legacy/downloadable

Fork of MaxMind GeoIP PHP API with improved error handling

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind

19/07 2013

v1.22

1.22.0.0 http://dev.maxmind.com/geoip/legacy/downloadable

Fork of MaxMind GeoIP PHP API with improved error handling

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind

19/07 2013

1.5

1.5.0.0 http://dev.maxmind.com/geoip/legacy/downloadable

Fork of MaxMind GeoIP PHP API with improved error handling

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind

15/07 2013

v1.14

1.14.0.0 http://dev.maxmind.com/geoip/legacy/downloadable

Fork of MaxMind GeoIP PHP API with improved error handling

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind

27/05 2013

v1.13

1.13.0.0 http://dev.maxmind.com/geoip/legacy/downloadable

MaxMind GeoIP PHP API

  Sources   Download

LGPL 2.1+

geoip geolocation maxmind