Skip to content
This repository has been archived by the owner on Dec 3, 2020. It is now read-only.

cdzombak/Geolocator-PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Geolocator-PHP

Geolocator provides an easy-to-use, versatile, object-oriented interface to the IP Location API provided by ipinfodb.com. This API allows you to find the city, state/region, country, and approximate latitude/longitude associated with an IP address or domain.

It requires PHP 5.3.0 or greater, with cURL and JSON support. (It may work with less than v5.3.0, but this is not supported.)

Features

  • Versatile interface for location lookups of one or many domains/IPs
  • Allows some array and iterator behavior for simplicity when working with large datasets (not yet totally implemented)
  • Most methods are chainable, meaning you can do things like $location = Geolocator::instantiate($apiKey, $myIp)->setPrecision(Geolocator::PRECISION_COUNTRY)->getLocation(); on one line
  • User can control when blocking (network) operations occur.

Usage

General guide to using the class:

  1. Create the Geolocator object. Set the API key in the constructor.
  2. Add one or multiple IPs/domains.
  3. Access the results.

For complete documentation, see the documentationn (in JavaDoc format) in the Geolocator class.

For examples of using this class and all its features, see the examples directory in this distribution.

Current Versions

The current and development versions are maintained on Github.

There is not currently a stable working version. v3 (beta) is currently in development and is stable enough for development.

Licensing

The project is dual-licensed under the MIT license and the GPLv3.

Author

This software was written by Chris Dzombak.

About

[UNMAINTAINED] Easy-to-use object-oriented interface to a geolocation API to find the physical location of an IP address or domain.

Resources

Stars

Watchers

Forks

Languages