class DolGeoIP (View source)

\class DolGeoIP \brief Class to manage GeoIP conversion Usage: $geoip=new GeoIP('country',$datfile); $geoip->getCountryCodeFromIP($ip); $geoip->close();

Properties

Reader|GeoIP|string $gi
string $error
string $errorlabel

Methods

__construct("country"|"city" $type, string $datfile)

Constructor

string
getCountryCodeFromIP(string $ip)

Return in lower case the country code from an ip

string
getCountryCodeFromName(string $name)

Return in lower case the country code from a host name

string
getVersion()

Return version of data file

void
close()

Close geoip object

Details

__construct("country"|"city" $type, string $datfile)

Constructor

Parameters

"country"|"city" $type

'country' or 'city'

string $datfile

Data file

string getCountryCodeFromIP(string $ip)

Return in lower case the country code from an ip

Parameters

string $ip

IP to scan

Return Value

string

Country code (two letters)

string getCountryCodeFromName(string $name)

Return in lower case the country code from a host name

Parameters

string $name

FQN of host (example: myserver.xyz.com)

Return Value

string

Country code (two letters)

string getVersion()

Return version of data file

Return Value

string

Version of datafile

void close()

Close geoip object

Return Value

void