Piwik\Plugins\UserCountry\LocationProvider\GeoIp\Php::getSupportedLocationInfo PHP Метод

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
    public function getSupportedLocationInfo()
    {
        $result = array();
        // country & continent info always available
        $result[self::CONTINENT_CODE_KEY] = true;
        $result[self::CONTINENT_NAME_KEY] = true;
        $result[self::COUNTRY_CODE_KEY] = true;
        $result[self::COUNTRY_NAME_KEY] = true;
        $locationGeoIp = $this->getGeoIpInstance($key = 'loc');
        if ($locationGeoIp) {
            switch ($locationGeoIp->databaseType) {
                case GEOIP_CITY_EDITION_REV0:
                    // city database type
                // city database type
                case GEOIP_CITY_EDITION_REV1:
                case GEOIP_CITYCOMBINED_EDITION:
                    $result[self::REGION_CODE_KEY] = true;
                    $result[self::REGION_NAME_KEY] = true;
                    $result[self::CITY_NAME_KEY] = true;
                    $result[self::AREA_CODE_KEY] = true;
                    $result[self::LATITUDE_KEY] = true;
                    $result[self::LONGITUDE_KEY] = true;
                    $result[self::POSTAL_CODE_KEY] = true;
                    break;
                case GEOIP_REGION_EDITION_REV0:
                    // region database type
                // region database type
                case GEOIP_REGION_EDITION_REV1:
                    $result[self::REGION_CODE_KEY] = true;
                    $result[self::REGION_NAME_KEY] = true;
                    break;
                default:
                    // country or unknown database type
                    break;
            }
        }
        // check if isp info is available
        if ($this->getGeoIpInstance($key = 'isp')) {
            $result[self::ISP_KEY] = true;
        }
        // check of org info is available
        if ($this->getGeoIpInstance($key = 'org')) {
            $result[self::ORG_KEY] = true;
        }
        return $result;
    }