\Geoip
Routines for IP to country resolution.
Synopsis
class Geoip
{
- // members
- private static boolean $enabled = true;
- private static boolean $default_country_code = false;
- protected static array $iso_3166_countryCodes = ;
- // methods
- public static void set_enabled()
- public static bool is_enabled()
- public static void set_default_country_code()
- public static string get_default_country_code()
- public static void ip2country()
- public static string|bool visitor_country()
- public static bool ip2country_check()
- public static null|string countryCode2name()
- public static array getCountryDropDown()
Members
private
- $default_country_code
- $enabled
protected
- $iso_3166_countryCodes
—
array
ISO 3166 Country Codes
Methods
public
- countryCode2name() — Returns the country name from the appropriate code.
- getCountryDropDown() — Returns an array of ISO Country Codes -> Country Names
- get_default_country_code() — Returns the default country code
- ip2country() — Find the country for an IP address.
- ip2country_check() — Sanity Checker for this class, which helps us debug, or ensure that its working as expected
- is_enabled() — Return whether Geoip lookups are enabled
- set_default_country_code() — Set the default country code
- set_enabled() — Set whether the Geoip lookup should be enabled or not. Useful to disable while testing or in environments Geoip lookup is wrong
- visitor_country() — Returns the country code, for the current visitor