PHP Class Piwik\Plugins\UserCountry\LocationProvider\GeoIp

Inheritance: extends Piwik\Plugins\UserCountry\LocationProvider
Afficher le fichier Open project: piwik/piwik Class Usage Examples

Méthodes publiques

Свойство Type Description
$dbNames array Stores possible database file names categorized by the type of information GeoIP databases hold.
$geoIPDatabaseDir

Méthodes publiques

Méthode Description
completeLocationResult ( array &$location ) Attempts to fill in some missing information in a GeoIP location.
getGeoIPDatabaseTypeFromFilename ( string $filename ) : string | false Returns the type of GeoIP database ('loc', 'isp' or 'org') based on the filename (eg, 'GeoLiteCity.dat', 'GeoIPISP.dat', etc).
getPathForGeoIpDatabase ( string $filename ) : string Returns full path for a GeoIP database managed by Piwik.
getPathToGeoIpDatabase ( array $possibleFileNames ) : string | false Returns the path of an existing GeoIP database or false if none can be found.
getRegionNameFromCodes ( string $countryCode, string $regionCode ) : string Returns a region name for a country code + region code.
getRegionNames ( ) : array Returns an array of region names mapped by country code & region code.
isDatabaseInstalled ( ) : boolean Returns true if there is a GeoIP database in the 'misc' directory.
isWorking ( ) : boolean | string Returns true if this provider has been setup correctly, the error message if otherwise.

Méthodes protégées

Méthode Description
fixupLocation ( &$location ) Fix up data to work with our SVG maps which include 'Tib' boundaries

Private Methods

Méthode Description
getTestIpAndResult ( ) : array Returns test IP used by isWorking and expected result.

Method Details

completeLocationResult() public méthode

This method will call LocationProvider::completeLocationResult and then try to set the region name of the location if the country code & region code are set.
public completeLocationResult ( array &$location )
$location array The location information to modify.

fixupLocation() protected méthode

Fix up data to work with our SVG maps which include 'Tib' boundaries
protected fixupLocation ( &$location )

getGeoIPDatabaseTypeFromFilename() public static méthode

Returns the type of GeoIP database ('loc', 'isp' or 'org') based on the filename (eg, 'GeoLiteCity.dat', 'GeoIPISP.dat', etc).
public static getGeoIPDatabaseTypeFromFilename ( string $filename ) : string | false
$filename string
Résultat string | false 'loc', 'isp', 'org', or false if cannot find a database type.

getPathForGeoIpDatabase() public static méthode

Returns full path for a GeoIP database managed by Piwik.
public static getPathForGeoIpDatabase ( string $filename ) : string
$filename string Name of the .dat file.
Résultat string

getPathToGeoIpDatabase() public static méthode

Returns the path of an existing GeoIP database or false if none can be found.
public static getPathToGeoIpDatabase ( array $possibleFileNames ) : string | false
$possibleFileNames array The list of possible file names for the GeoIP database.
Résultat string | false

getRegionNameFromCodes() public static méthode

Returns a region name for a country code + region code.
public static getRegionNameFromCodes ( string $countryCode, string $regionCode ) : string
$countryCode string
$regionCode string
Résultat string The region name or 'Unknown' (translated).

getRegionNames() public static méthode

Returns an array of region names mapped by country code & region code.
public static getRegionNames ( ) : array
Résultat array

isDatabaseInstalled() public static méthode

Returns true if there is a GeoIP database in the 'misc' directory.
public static isDatabaseInstalled ( ) : boolean
Résultat boolean

isWorking() public méthode

Returns true if this provider has been setup correctly, the error message if otherwise.
public isWorking ( ) : boolean | string
Résultat boolean | string

Property Details

$dbNames public_oe static_oe property

Stores possible database file names categorized by the type of information GeoIP databases hold.
public static array $dbNames
Résultat array

$geoIPDatabaseDir public_oe static_oe property

public static $geoIPDatabaseDir