Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct () | |
_getCountryCodeOnList ($countryCode, $countryCodeListName) | |
get2LettersCountryCode ($countryCode3) | |
get3LettersCountryCode ($countryCode) | |
getAllCountryCodes () | |
getGeoLocation ($ip) | |
getRegions ($countryId) | |
isPresent () | |
Data Fields | |
$_geoLocationTool | |
$_isDbFilePresent | |
$_regionName | |
Geo location by ip wrapper class.
GeoIp tool for geo location based on ip
Definition at line 19 of file GeoLocationTool.inc.php.
GeoLocationTool::__construct | ( | ) |
Constructor. If we cannot find the database file, an empty object will be constructed. Use the method isPresent() to check if the database file is present before use.
Definition at line 32 of file GeoLocationTool.inc.php.
GeoLocationTool::_getCountryCodeOnList | ( | $countryCode, | |
$countryCodeListName | |||
) |
Get the passed country code inside the passed list.
$countryCode | The 2 letters country code. |
$countryCodeList | array Any geoip country code list. |
Definition at line 144 of file GeoLocationTool.inc.php.
References $_geoLocationTool, and $tool.
Referenced by get2LettersCountryCode(), and get3LettersCountryCode().
GeoLocationTool::get2LettersCountryCode | ( | $countryCode3 | ) |
Return the 2 letter version of country codes based on the passed 3 letters version.
$countryCode3 | string |
Definition at line 117 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.
$countryCode | string |
Definition at line 107 of file GeoLocationTool.inc.php.
References _getCountryCodeOnList().
GeoLocationTool::getAllCountryCodes | ( | ) |
Get all country codes.
Definition at line 89 of file GeoLocationTool.inc.php.
References $_geoLocationTool, and $tool.
GeoLocationTool::getGeoLocation | ( | $ip | ) |
Return country code and city name for the passed ip address.
$ip | string |
Definition at line 63 of file GeoLocationTool.inc.php.
GeoLocationTool::getRegions | ( | $countryId | ) |
Get regions by country.
$countryId | int |
Definition at line 126 of file GeoLocationTool.inc.php.
References $_regionName.
GeoLocationTool::isPresent | ( | ) |
Identify if the geolocation database tool is available for use.
Definition at line 53 of file GeoLocationTool.inc.php.
References $_isDbFilePresent.
GeoLocationTool::$_geoLocationTool |
Definition at line 21 of file GeoLocationTool.inc.php.
Referenced by _getCountryCodeOnList(), and getAllCountryCodes().
GeoLocationTool::$_isDbFilePresent |
Definition at line 25 of file GeoLocationTool.inc.php.
Referenced by isPresent().
GeoLocationTool::$_regionName |
Definition at line 23 of file GeoLocationTool.inc.php.
Referenced by getRegions().