public static function setCurrentProvider($providerId)
    {
        $provider = self::getProviderById($providerId);
        if (empty($provider)) {
            throw new Exception(
                "Invalid provider ID '$providerId'. The provider either does not exist or is not available");
        }

        $provider->activate();

        Option::set(self::CURRENT_PROVIDER_OPTION_NAME, $providerId);
        Cache::clearCacheGeneral();
        return $provider;
    }
public static function setCurrentProvider($providerId)
    {
        $provider = self::getProviderById($providerId);
        if (empty($provider)) {
            throw new Exception(
                "Invalid provider ID '$providerId'. The provider either does not exist or is not available");
        }

        $provider->activate();

        Option::set(self::CURRENT_PROVIDER_OPTION_NAME, $providerId);
        Cache::clearCacheGeneral();
        return $provider;
    }
public static function setCurrentProvider ( $ providerId ) { $ provider = self :: getProviderById ( $ providerId ) ; if ( empty ( $ provider ) ) { throw new Exception ( "Invalid provider ID '$providerId'. The provider either does not exist or is not available" ) ; } $ provider -> activate ( ) ; Option :: set ( self :: CURRENT_PROVIDER_OPTION_NAME , $ providerId ) ; Cache :: clearCacheGeneral ( ) ; return $ provider ; }
Sets the provider to use when tracking.

@param string $providerId The ID of the provider to use.
@return \Piwik\Plugins\UserCountry\LocationProvider The new current provider.
@throws Exception If the provider ID is invalid.
Sets the provider to use when tracking .