PHP Class Pop\Geo\Geo

Author: Nick Sagona, III ([email protected])
Afficher le fichier Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Свойство Type Description
$databases string Array of available databases
$host string Host name to look up
$hostInfo array Host info
$latitude string Latitude value
$longitude string Longitude value

Méthodes publiques

Méthode Description
__construct ( array $options = [] ) : Geo Constructor
__get ( string $name ) : mixed Get method to return the value of hostInfo[$name].
calculateDistance ( array $origin, array $destination, integer $round = 2, boolean $km = false ) : mixed Method to calculate the distance between 2 sets of coordinate
distanceTo ( Geo $dest, integer $round = 2, boolean $km = false ) : mixed Get distance from current Geo object coordinates to another
getDatabases ( ) : array Get all available databases
getHostInfo ( ) : array Get host info
getLatitude ( ) : string Get latitude
getLongitude ( ) : string Get longitude
isDbAvailable ( string $name ) : boolean Get an available database

Méthodes protégées

Méthode Description
getAvailableDatabases ( ) : void Get available databases
getGeoIpHostInfo ( ) : void Get GeoIp host information

Method Details

__construct() public méthode

Instantiate the Geo object.
public __construct ( array $options = [] ) : Geo
$options array
Résultat Geo

__get() public méthode

Get method to return the value of hostInfo[$name].
public __get ( string $name ) : mixed
$name string
Résultat mixed

calculateDistance() public static méthode

Method to calculate the distance between 2 sets of coordinate
public static calculateDistance ( array $origin, array $destination, integer $round = 2, boolean $km = false ) : mixed
$origin array
$destination array
$round integer
$km boolean
Résultat mixed

distanceTo() public méthode

Get distance from current Geo object coordinates to another
public distanceTo ( Geo $dest, integer $round = 2, boolean $km = false ) : mixed
$dest Geo
$round integer
$km boolean
Résultat mixed

getAvailableDatabases() protected méthode

Get available databases
protected getAvailableDatabases ( ) : void
Résultat void

getDatabases() public méthode

Get all available databases
public getDatabases ( ) : array
Résultat array

getGeoIpHostInfo() protected méthode

Get GeoIp host information
protected getGeoIpHostInfo ( ) : void
Résultat void

getHostInfo() public méthode

Get host info
public getHostInfo ( ) : array
Résultat array

getLatitude() public méthode

Get latitude
public getLatitude ( ) : string
Résultat string

getLongitude() public méthode

Get longitude
public getLongitude ( ) : string
Résultat string

isDbAvailable() public méthode

Get an available database
public isDbAvailable ( string $name ) : boolean
$name string
Résultat boolean

Property Details

$databases protected_oe property

Array of available databases
protected string $databases
Résultat string

$host protected_oe property

Host name to look up
protected string $host
Résultat string

$hostInfo protected_oe property

Host info
protected array $hostInfo
Résultat array

$latitude protected_oe property

Latitude value
protected string $latitude
Résultat string

$longitude protected_oe property

Longitude value
protected string $longitude
Résultat string