forked from Pollenizer/CakePHP-GeoIP-Plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
45 lines (31 loc) · 1.3 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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. Download the MaxMind GeoLite City Database at http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
3. Uncompress the database to app/Plugin/GeoIp/data/GeoIP.dat
Usage
-----
Just load the behavior
```php
class MyModel extends AppModel {
public $actsAs = array('GeoIp.GeoIp);
}
```
You can then call:
```php
$location = $this->MyModel->ipLookup(CakeRequest::clientIp(false));
```
Contributing to this Plugin
---------------------------
Please feel free to contribute to the plugin with new issues, requests, unit tests and code fixes or new features. If you want to contribute some code, create a feature branch from develop, and send us your pull request. Unit tests for new features and issues detected are mandatory to keep quality high.
License
-------
Licensed under [The MIT License](http://www.opensource.org/licenses/mit-license.php)<br/>
Redistributions of files must retain the above copyright notice.