Skip to content

A CakePHP Plugin for finding a location based on an IP Address using the MaxMind GeoIP database and the PEAR Net_GeoIP package

Notifications You must be signed in to change notification settings

ilevennet/CakePHP-GeoIP-Plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CakePHP GeoIP Plugin

A CakePHP Plugin for finding a location based on an IP Address using the MaxMind GeoIP database and the PEAR Net_GeoIP package.

SEE ALSO
------------

http://www.maxmind.com/app/ip-location
http://pear.php.net/package/Net_GeoIP/
http://pear.php.net/manual/en/package.networking.net-geoip.lookuplocation.php

INSTALLATION
------------

1. Copy the plugin to app/Plugin/GeoIp
2. Add <code>CakePlugin::load('GeoIp');</code> to <code>bootstrap.php</code>
3. Download the MaxMind GeoLite City Database at http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
4. Uncompress the database to app/Plugin/GeoIp/data/GeoIP.dat

USAGE
---------------

```php
    App::uses('GeoIpLocation', 'GeoIp.Model');
    $GeoIpLocation = new GeoIpLocation();
    $ipAddr = CakeRequest::clientIp(false);
    $location = $GeoIpLocation->find($ipAddr);
```

About

A CakePHP Plugin for finding a location based on an IP Address using the MaxMind GeoIP database and the PEAR Net_GeoIP package

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published