forked from Pollenizer/CakePHP-GeoIP-Plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
28 lines (21 loc) · 870 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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);
```