Method | Description | |
---|---|---|
__construct ( array | boolean $customDbNames = false ) | Constructor. | |
__destruct ( ) | Closes all open geoip instances. | |
getInfo ( ) : array | Returns information about this location provider. Contains an id, title & description: | |
getLocation ( array $info ) : array | Uses a GeoIP database to get a visitor's location based on their IP address. | |
getSupportedLocationInfo ( ) : array | Returns an array describing the types of location information this provider will return. | |
isAvailable ( ) : boolean | Returns true if this location provider is available. Piwik ships w/ the MaxMind PHP library, so this provider is available if a location GeoIP database can be found. | |
isWorking ( ) : boolean | string | Returns true if this provider has been setup correctly, the error message if otherwise. |
Method | Description | |
---|---|---|
getGeoIpInstance ( string $key ) : object | false | Returns a GeoIP instance. Creates it if necessary. |
public __construct ( array | boolean $customDbNames = false ) | ||
$customDbNames | array | boolean | The possible filenames for each type of GeoIP database. eg array( 'loc' => array('GeoLiteCity.dat'), 'isp' => array('GeoIP.dat', 'GeoIPISP.dat') 'org' => array('GeoIPOrg.dat') ) If a key is missing (or the parameter not supplied), then the default database names are used. |
public getLocation ( array $info ) : array | ||
$info | array | Must have an 'ip' field. |
return | array |
public getSupportedLocationInfo ( ) : array | ||
return | array |
public isAvailable ( ) : boolean | ||
return | boolean |