dolibarr  7.0.0-beta
Public Member Functions | List of all members
DolGeoIP Class Reference

Classe to manage GeoIP Usage: $geoip=new GeoIP('country',$datfile); $geoip->getCountryCodeFromIP($ip); $geoip->close();. More...

Public Member Functions

 __construct ($type, $datfile)
 Constructor. More...
 
 getCountryCodeFromIP ($ip)
 Return in lower case the country code from an ip. More...
 
 getCountryCodeFromName ($name)
 Return in lower case the country code from a host name. More...
 
 getVersion ()
 Return verion of data file. More...
 
 close ()
 Close geoip object. More...
 

Detailed Description

Classe to manage GeoIP Usage: $geoip=new GeoIP('country',$datfile); $geoip->getCountryCodeFromIP($ip); $geoip->close();.

Definition at line 34 of file dolgeoip.class.php.

Constructor & Destructor Documentation

DolGeoIP::__construct (   $type,
  $datfile 
)

Constructor.

Parameters
string$type'country' or 'city'
string$datfileData file

Definition at line 44 of file dolgeoip.class.php.

References dol_syslog(), and print.

Member Function Documentation

DolGeoIP::close ( )

Close geoip object.

Returns
void

Definition at line 140 of file dolgeoip.class.php.

DolGeoIP::getCountryCodeFromIP (   $ip)

Return in lower case the country code from an ip.

Parameters
string$ipIP to scan
Returns
string Country code (two letters)

Definition at line 91 of file dolgeoip.class.php.

DolGeoIP::getCountryCodeFromName (   $name)

Return in lower case the country code from a host name.

Parameters
string$nameFQN of host (example: myserver.xyz.com)
Returns
string Country code (two letters)

Definition at line 115 of file dolgeoip.class.php.

DolGeoIP::getVersion ( )

Return verion of data file.

Returns
string Version of datafile

Definition at line 129 of file dolgeoip.class.php.


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