PHP 클래스 Piwik\Plugins\UserCountry\LocationProvider\GeoIp\ServerBased

To make this provider available, make sure the GEOIP_ADDR server variable is set.
상속: extends Piwik\Plugins\UserCountry\LocationProvider\GeoIp
파일 보기 프로젝트 열기: piwik/piwik

공개 메소드들

메소드 설명
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 | string Checks if an HTTP server module has been installed. It checks by looking for the GEOIP_ADDR server variable.
isSameOrAnonymizedIp ( string $ip, string $currentIp ) : boolean Checks if two IP addresses are the same or if the first is the anonymized version of the other.
isWorking ( ) : boolean Returns true if the GEOIP_ADDR server variable is defined.

메소드 상세

getInfo() 공개 메소드

array( 'id' => 'geoip_serverbased', 'title' => '...', 'description' => '...' );
public getInfo ( ) : array
리턴 array

getLocation() 공개 메소드

This function will return different results based on the data used and based on how the GeoIP module is configured. If a region database is used, it may return the country code, region code, city name, area code, latitude, longitude and postal code of the visitor. Alternatively, only the country code may be returned for another database. If your HTTP server is not configured to include all GeoIP information, some information will not be available to Piwik.
public getLocation ( array $info ) : array
$info array Must have an 'ip' field.
리턴 array

getSupportedLocationInfo() 공개 메소드

There's no way to tell exactly what database the HTTP server is using, so we just assume country and continent information is available. This can make diagnostics a bit more difficult, unfortunately.
public getSupportedLocationInfo ( ) : array
리턴 array

isAvailable() 공개 메소드

There's a special check for the Apache module, but we can't check specifically for anything else.
public isAvailable ( ) : boolean | string
리턴 boolean | string

isSameOrAnonymizedIp() 공개 정적인 메소드

Checks if two IP addresses are the same or if the first is the anonymized version of the other.
public static isSameOrAnonymizedIp ( string $ip, string $currentIp ) : boolean
$ip string
$currentIp string This IP should not be anonymized.
리턴 boolean

isWorking() 공개 메소드

Returns true if the GEOIP_ADDR server variable is defined.
public isWorking ( ) : boolean
리턴 boolean