PHP Class Piwik\Plugins\UserCountry\LocationProvider\DefaultProvider

Inheritance: extends Piwik\Plugins\UserCountry\LocationProvider
Show file Open project: piwik/piwik

Public Methods

Method Description
getInfo ( ) : array Returns information about this location provider. Contains an id, title & description:
getLocation ( array $info ) : array Guesses a visitor's location using a visitor's browser language.
getSupportedLocationInfo ( ) : array Returns an array describing the types of location information this provider will return.
isAvailable ( ) : boolean Returns whether this location provider is available.
isWorking ( ) : boolean Returns whether this location provider is working correctly.

Method Details

getInfo() public method

array( 'id' => 'default', 'title' => '...', 'description' => '...' );
public getInfo ( ) : array
return array

getLocation() public method

Guesses a visitor's location using a visitor's browser language.
public getLocation ( array $info ) : array
$info array Contains 'ip' & 'lang' keys.
return array Contains the guessed country code mapped to LocationProvider::COUNTRY_CODE_KEY.

getSupportedLocationInfo() public method

This provider supports the following types of location info: - continent code - continent name - country code - country name
public getSupportedLocationInfo ( ) : array
return array

isAvailable() public method

This implementation is always available.
public isAvailable ( ) : boolean
return boolean always true

isWorking() public method

This implementation is always working correctly.
public isWorking ( ) : boolean
return boolean always true