PHP Класс Piwik\Plugins\UserCountry\LocationProvider\GeoIp\Pecl

FIXME: For some reason, if the PECL module is loaded & an organization DB is available, the PHP module won't return organization info. If the PECL module is not loaded, organization info is returned.
Наследование: extends Piwik\Plugins\UserCountry\LocationProvider\GeoIp
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$forceDisable For tests.

Открытые методы

Метод Описание
getInfo ( ) : array Returns information about this location provider. Contains an id, title & description:
getLocation ( array $info ) : array Uses the GeoIP PECL module 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 the PECL module is installed and loaded, false if otherwise.
isCityDatabaseAvailable ( ) : boolean Returns true if the PECL module can detect a city database.
isCountryDatabaseAvailable ( ) : boolean Returns true if the PECL module can detect a country database.
isISPDatabaseAvailable ( ) : boolean Returns true if the PECL module can detect an ISP database.
isLocationDatabaseAvailable ( ) : boolean Returns true if the PECL module can detect a location database (either a country, region or city will do).
isOrgDatabaseAvailable ( ) : boolean Returns true if the PECL module can detect an organization database.
isRegionDatabaseAvailable ( ) : boolean Returns true if the PECL module can detect a region database.
isWorking ( ) : boolean Returns true if the PECL module that is installed can be successfully used to get the location of an IP address.

Описание методов

getInfo() публичный Метод

array( 'id' => 'geoip_pecl', 'title' => '...', 'description' => '...' );
public getInfo ( ) : array
Результат array

getLocation() публичный Метод

This function will return different results based on the data available. If a city database can be detected by the PECL module, it may return the country code, region code, city name, area code, latitude, longitude and postal code of the visitor. Alternatively, if only the country database can be detected, only the country code will be returned. The GeoIP PECL module will detect the following filenames: - GeoIP.dat - GeoIPCity.dat - GeoIPISP.dat - GeoIPOrg.dat Note how GeoLiteCity.dat, the name for the GeoLite city database, is not detected by the PECL module.
public getLocation ( array $info ) : array
$info array Must have an 'ip' field.
Результат array

getSupportedLocationInfo() публичный Метод

The location info this provider supports depends on what GeoIP databases it can find. This provider will always support country & continent information. If a region database is found, then region code & name information will be supported. If a city database is found, then region code, region name, city name, area code, latitude, longitude & postal code are all supported. If an organization database is found, organization information is supported. If an ISP database is found, ISP information is supported.
public getSupportedLocationInfo ( ) : array
Результат array

isAvailable() публичный Метод

Returns true if the PECL module is installed and loaded, false if otherwise.
public isAvailable ( ) : boolean
Результат boolean

isCityDatabaseAvailable() публичный статический Метод

Returns true if the PECL module can detect a city database.
public static isCityDatabaseAvailable ( ) : boolean
Результат boolean

isCountryDatabaseAvailable() публичный статический Метод

Returns true if the PECL module can detect a country database.
public static isCountryDatabaseAvailable ( ) : boolean
Результат boolean

isISPDatabaseAvailable() публичный статический Метод

Returns true if the PECL module can detect an ISP database.
public static isISPDatabaseAvailable ( ) : boolean
Результат boolean

isLocationDatabaseAvailable() публичный статический Метод

Returns true if the PECL module can detect a location database (either a country, region or city will do).
public static isLocationDatabaseAvailable ( ) : boolean
Результат boolean

isOrgDatabaseAvailable() публичный статический Метод

Returns true if the PECL module can detect an organization database.
public static isOrgDatabaseAvailable ( ) : boolean
Результат boolean

isRegionDatabaseAvailable() публичный статический Метод

Returns true if the PECL module can detect a region database.
public static isRegionDatabaseAvailable ( ) : boolean
Результат boolean

isWorking() публичный Метод

Returns true if the PECL module that is installed can be successfully used to get the location of an IP address.
public isWorking ( ) : boolean
Результат boolean

Описание свойств

$forceDisable публичное статическое свойство

For tests.
public static $forceDisable