Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
GeoLocationTool Class Reference

Public Member Functions

 _getCountryCodeOnList ($countryCode, $countryCodeListName)
 
 GeoLocationTool ()
 
 get2LettersCountryCode ($countryCode3)
 
 get3LettersCountryCode ($countryCode)
 
 getAllCountryCodes ()
 
 getGeoLocation ($ip)
 
 getRegions ($countryId)
 

Detailed Description

Geo location by ip wrapper class.

GeoIp tool for geo location based on ip

Definition at line 19 of file GeoLocationTool.inc.php.

Member Function Documentation

GeoLocationTool::_getCountryCodeOnList (   $countryCode,
  $countryCodeListName 
)

Get the passed country code inside the passed list.

Parameters
$countryCodeThe 2 letters country code.
$countryCodeListarray Any geoip country code list.
Returns
mixed String or null.

Definition at line 133 of file GeoLocationTool.inc.php.

Referenced by get2LettersCountryCode(), and get3LettersCountryCode().

GeoLocationTool::GeoLocationTool ( )

Constructor.

Parameters
$argvarray command-line arguments

Definition at line 31 of file GeoLocationTool.inc.php.

GeoLocationTool::get2LettersCountryCode (   $countryCode3)

Return the 2 letter version of country codes based on the passed 3 letters version.

Parameters
$countryCode3string
Returns
mixed string or null

Definition at line 106 of file GeoLocationTool.inc.php.

References _getCountryCodeOnList().

GeoLocationTool::get3LettersCountryCode (   $countryCode)

Return the 3 letters version of country codes based on the passed 2 letters version.

Parameters
$countryCodestring
Returns
mixed string or null

Definition at line 96 of file GeoLocationTool.inc.php.

References _getCountryCodeOnList().

GeoLocationTool::getAllCountryCodes ( )

Get all country codes.

Returns
mixed array or null

Definition at line 78 of file GeoLocationTool.inc.php.

GeoLocationTool::getGeoLocation (   $ip)

Return country code and city name for the passed ip address.

Parameters
$ipstring
Returns
array

Definition at line 52 of file GeoLocationTool.inc.php.

GeoLocationTool::getRegions (   $countryId)

Get regions by country.

Parameters
$countryIdint
Returns
array

Definition at line 115 of file GeoLocationTool.inc.php.


The documentation for this class was generated from the following file: