2017 © Pedro Peláez
 

library pop-geo

Pop Geo Component for Pop PHP Framework

image

popphp/pop-geo

Pop Geo Component for Pop PHP Framework

  • Friday, July 8, 2016
  • by nicksagona
  • Repository
  • 1 Watchers
  • 2 Stars
  • 443 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

pop-geo

Build Status Coverage Status, (*1)

END OF LIFE

The pop-geo component v2.1.0 is now end-of-life and will no longer be supported due to lack of support for the GeoIP extension in PHP 7., (*2)

OVERVIEW

pop-geo is a component for leveraging the GeoIP databases and calculating information about IP location as well as distances between sets of longitude and latitude points., (*3)

pop-geo is a component of the Pop PHP Framework., (*4)

INSTALL

Install pop-geo using Composer., (*5)

composer require popphp/pop-geo

BASIC USAGE

If the GeoIP extension and databases are installed, it will autodetect information based on the IP., (*6)

use Pop\Geo\Geo;

$nola = new Geo();

echo $nola->getLatitude();  // 29.9546500
echo $nola->getLongitude(); // -90.0750700
Calculate the distance between to sets of points

You can give it a second set of coordinates to calculate the distance between them:, (*7)

$houston = new Geo([
    'latitude'  => 29.7632800,
    'longitude' => -95.3632700
]);

echo $nola->distanceTo($houston);          // Outputs '317.11' miles
echo $nola->distanceTo($houston, 2, true); // Outputs '510.34' kilometers

You can also manually give it 2 sets of points as well:, (*8)

use Pop\Geo\Geo;

$nola = [
    'latitude'  => 29.9546500,
    'longitude' => -90.0750700
];

$houston = [
    'latitude'  => 29.7632800,
    'longitude' => -95.3632700
];

echo Geo::calculateDistance($nola, $houston); // Outputs '317.11' miles

The Versions

08/07 2016

dev-master

9999999-dev http://www.popphp.org/

Pop Geo Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

geoip php geo pop pop php

08/07 2016

2.1.0p1

2.1.0.0-patch1 http://www.popphp.org/

Pop Geo Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

geoip php geo pop pop php

01/07 2016

2.1.0

2.1.0.0 http://www.popphp.org/

Pop Geo Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

geoip php geo pop pop php

10/05 2016

2.0.0p2

2.0.0.0-patch2 http://www.popphp.org/

Pop Geo Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

geoip php geo pop pop php

19/02 2016

2.0.0p1

2.0.0.0-patch1 http://www.popphp.org/

Pop Geo Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

geoip php geo pop pop php

21/07 2015

2.0.0

2.0.0.0 http://www.popphp.org/

Pop Geo Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

geoip php geo pop pop php