WC_Geolite_Integration
in package
Geolite integration class.
Tags
Table of Contents
- $database : string
- MaxMind GeoLite2 database path.
- $log : WC_Logger
- Logger instance.
- __construct() : mixed
- Constructor.
- get_country_iso() : string
- Get country 2-letters ISO by IP address.
- log() : mixed
- Logging method.
Properties
$database
MaxMind GeoLite2 database path.
private
string
$database
= ''
$log
Logger instance.
private
WC_Logger
$log
=
ull
Methods
__construct()
Constructor.
public
__construct(string $database) : mixed
Parameters
- $database : string
-
MaxMind GeoLite2 database path.
Return values
mixed —get_country_iso()
Get country 2-letters ISO by IP address.
public
get_country_iso(string $ip_address) : string
Returns empty string when not able to find any ISO code.
Parameters
- $ip_address : string
-
User IP address.
Tags
Return values
string —log()
Logging method.
private
log(string $message[, string $level = 'info' ]) : mixed
Parameters
- $message : string
-
Log message.
- $level : string = 'info'
-
Log level. Available options: 'emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'info' and 'debug'. Defaults to 'info'.