Piwik\Plugins\UserCountry\API::setLocationProvider PHP Метод

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

Set the location provider
public setLocationProvider ( string $providerId )
$providerId string The ID of the provider to use eg 'default', 'geoip_php', ...
    public function setLocationProvider($providerId)
    {
        Piwik::checkUserHasSuperUserAccess();
        if (!UserCountry::isGeoLocationAdminEnabled()) {
            throw new \Exception('Setting geo location has been disabled in config.');
        }
        $provider = LocationProvider::setCurrentProvider($providerId);
        if ($provider === false) {
            throw new Exception("Invalid provider ID: '{$providerId}'.");
        }
    }