A CakePHP Plugin for finding a location based on an IP Address using the MaxMind GeoIP database and the PEAR Net_GeoIP package
PHP
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 2 commits ahead of Pollenizer:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Lib
Model
README

README

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);
```