https://github.com/xp-forge/geoip
MaxMind GeoIP database reader for the XP Framework
https://github.com/xp-forge/geoip
geoip geoip-database php xp-framework
Last synced: 3 months ago
JSON representation
MaxMind GeoIP database reader for the XP Framework
- Host: GitHub
- URL: https://github.com/xp-forge/geoip
- Owner: xp-forge
- Created: 2015-02-10T00:19:26.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-03-24T10:38:06.000Z (about 1 year ago)
- Last Synced: 2024-12-26T07:43:28.780Z (5 months ago)
- Topics: geoip, geoip-database, php, xp-framework
- Language: PHP
- Size: 62.5 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
Awesome Lists containing this project
README
GeoIP database
==============[](https://github.com/xp-forge/geoip/actions)
[](https://github.com/xp-framework/core)
[](https://github.com/xp-framework/core/blob/master/LICENCE.md)
[](http://php.net/)
[](http://php.net/)
[](https://packagist.org/packages/xp-forge/geoip)This API allows working with data geoips of different kinds in a functional style, e.g. map/reduce.
Examples
--------```php
use com\maxmind\geoip\GeoIpDatabase;
use io\File;$database= GeoIpDatabase::open(new File('GeoLite2-City.mmdb'));
$record= $database->lookup('8.8.8.8');
$database->close();// $record= com.maxmind.geoip.Record@{
// [city ] com.maxmind.geoip.Name(#5375480: Mountain View)
// [country ] com.maxmind.geoip.Name(#6252001: United States; code= US)
// [continent ] com.maxmind.geoip.Name(#6255149: North America; code= NA)
// [postalCode ] "94035"
// [location ] com.maxmind.geoip.Location(37.386,-122.0838; tz= America/Los_Angeles)
// [subdivisions] [com.maxmind.geoip.Name(#5332921: California; code= CA)]
// }
```See also
--------
* http://dev.maxmind.com/geoip/geoip2/geolite2/ GeoLite2 Free Downloadable Databases
* http://maxmind.github.io/MaxMind-DB/ MaxMind DB File Format Specification