Get the current DDns status by a given dynamic dns provider
@param string $provider
@return \alphayax\freebox\api\v3\models\Connection\DynDns\Status
167560
protected function getStatusFromProvider( $provider){
        $service = sprintf( self::API_CONNECTION_DDNS_STATUS, $provider);
        $rest = $this->getService( $service);
        $rest->GET();

        return $rest->getResult( models\Connection\DynDns\Status::class);
    }
17772
public function getProvider($provider)
    {
        $name = is_string($provider) ? $provider : get_class($provider);

        return Arr::first($this->serviceProviders, function ($key, $value) use ($name) {
            return $value instanceof $name;
        });
    }
789295
public function ToDoubleString( $provider )
	{
		$sign = $this->getIsNegative();

		if ( bccomp( $this->_value, bcpow( 2, 204 ) ) > 0 )
		{
			return $sign ? -INF : INF;
		}
		else if ( bccomp( $this->getAbs()->getValue(), bcpow( 2, -149, 149 ) ) < 0 )
		{
			return $sign ? 0 : -0;
		}

		$abs = $this->getAbs();
		$decimals = rtrim( $this->getDecimalPart(), "0" );

		if ( bccomp( $abs->getValue(), 1 ) == -1 )
		{
			// Are there enough bits available to store the number?
			if ( $this->dec2bin( $decimals ) > 56 )
			{
				$exponent = 1;
				// First remove leading zeros which become part of the exponent
				while( $decimals[0] == 0 )
				{
					$exponent++;
					$decimals = substr( $decimals, 1 );
				}

				$number = $decimals[0] . "." . substr( $decimals, 1 ) . "E-" . $exponent;
			}
			else
			{
				return $this->_value;
			}
		}
		else
		{
			$digits = $this->getAbs()->getIntegerPart();

			$mantissa = rtrim( $digits . $decimals, "0" );
			$exponentRequired = strlen( $digits ) >= 20;
			while ( strlen( $this->dec2bin( $mantissa ) ) > 56 )
			{
				$mantissa = bcdiv( $mantissa, 10, 0 );
				$exponentRequired = true;
			}

			$number = $mantissa;
			if ( $exponentRequired )
			{
				$number = $mantissa[0] . "." . substr( $mantissa, 1 );
				$exponent = strlen( $digits ) -1;
				$number .= "E$exponent";
			}
			else
			{
				$number = rtrim( $digits . "." . implode( "", explode( $digits, $mantissa, 2) ), "." );
			}
		}

		if ( $sign )
		{
			$number = "-" . $number;
		}

		return $number;
	}
928975
public function getRegistered($provider)
    {
        $name = is_string($provider) ? $provider : get_class($provider);

        if (array_key_exists($name, $this->loadedProviders)) {
            return array_first($this->serviceProviders, function($key, $value) use ($name)
            {
                return get_class($value) == $name;
            });
        }
    }
202178
public function getProvider($provider)
    {
        if (isset($this->aProviders['all'][strtolower($provider)])) {
            return $this->aProviders['all'][strtolower($provider)];
        } else {
            return false;
        }
    }
755879
public function connection(string $domain)
    {
        Assert::stringNotEmpty($domain);

        $response = $this->httpGet(sprintf('/v3/domains/%s/connection', $domain));

        return $this->hydrateResponse($response, ConnectionResponse::class);
    }
655635
protected function filterProviders(array $providers)
    {
        if (empty($providers)) {
            return $this->providers;
        }

        return array_intersect_key($this->providers, array_flip($providers));
    }
362680
public function load($provider, $options = null)
    {
        if (!is_object($provider)) {
            $provider = $this->getShared($provider);
        }
        $names = $provider->getNames();
        if (isset($options['aliases'])) {
            $services = $this->createServiceAliases($names, $options['aliases']);
            unset($options['aliases']);
        } else {
            $services = $names;
        }
        return $this->autoload($services, $provider, $options);
    }
685825
private function getProviderDetails($provider)
    {
        if (empty($this->providers)) {
            throw new \Exception('No Providers have been set in users config.');
        }

        $provider = is_null($provider) ? $this->providers->first() : $this->providers->get($provider);

        if (is_null($provider['driver'])) {
            throw new \InvalidArgumentException('You must set a social driver to use the social authenticating features.');
        }

        $this->driver = $provider['driver'];
        $this->scopes = $provider['scopes'];
        $this->extras = $provider['extras'];
    }
1202120
protected function getDnsRecord($domain)
    {
        if (filter_var($domain, FILTER_VALIDATE_URL) === false) {
            $this->eye->logger()->debug('DNS URL not valid', $domain);
            return false;
        }

        try {
            $dns = $this->pollDns($this->parseUrl($domain));
        } catch (Exception $e) {
            $this->eye->logger()->debug('DNS lookup failed', ['domain' => $domain,
                                                              'exception' => $e->getMessage()]);
            return false;
        }

        return $this->stripTtlFromDns($dns);
    }
537807
public function setProvider($provider = null)
    {
        $this->provider = null;

        if (null === ($provider = $this->internalResolveProvider($provider))) {
            $this->provider = $this->providerId = null;
        } else {
            $this->providerId = $provider->id;
            $this->provider = $provider;
        }

        return $this;
    }
477210
public function handleTimestampNonce($provider)
    {
        if (empty($provider->timestamp)) {
            $this->addError(OAUTH_BAD_TIMESTAMP, language()->getLine('OAUTH_BAD_TIMESTAMP'));

            return OAUTH_BAD_TIMESTAMP;
        }

        if (false !== ($token = $this->model->findTokenNonce([
                'nonce' => $provider->nonce,
            ]))) {
            if (time() > $token->expires) {
                $this->addError(OAUTH_TOKEN_EXPIRED, language()->getLine('OAUTH_TOKEN_EXPIRED'));

                return OAUTH_TOKEN_EXPIRED;
            }

            return OAUTH_OK;
        }

        $this->addError(OAUTH_BAD_NONCE, language()->getLine('OAUTH_BAD_NONCE'));

        return OAUTH_BAD_NONCE;
    }
283253
public function getDomainInfo($domain)
    {
        try {
            $result = $this->getDomainLookupQuery($domain)->getSingleResult();
        } catch (NoResultException $e) {
            $result = null;
        }

        return $result;
    }
143430
public function handleConsumer($provider)
    {
        $this->consumer = new DataStructures\Consumer();

        if (false !== ($consumer = $this->model->findConsumer(['key' => $provider->consumer_key]))) {
            $this->consumer->id = $consumer->id;
            $this->consumer->key = $consumer->key;
            $this->consumer->secret = $provider->consumer_secret = $consumer->secret;
            $this->consumer->status = $consumer->status;

            if ($consumer->status === 'ENABLED') {
                return OAUTH_OK;
            }

            $this->addError(OAUTH_CONSUMER_KEY_REFUSED, language()->getLine('OAUTH_CONSUMER_KEY_REFUSED'));

            return OAUTH_CONSUMER_KEY_REFUSED;
        }

        if (empty($this->oauth->bearer)) {
            $this->addError(OAUTH_CONSUMER_KEY_UNKNOWN, language()->getLine('OAUTH_CONSUMER_KEY_UNKNOWN'));
        } else {
            $this->addError(OAUTH_CONSUMER_KEY_UNKNOWN, language()->getLine('OAUTH_AUTHORIZATION_UNKNOWN'));
        }

        return OAUTH_CONSUMER_KEY_UNKNOWN;
    }
1110462
public function domainIndex(string $domain)
    {
        Assert::stringNotEmpty($domain);

        $response = $this->httpGet(sprintf('/v3/domains/%s/ip', $domain));

        return $this->hydrateResponse($response, IndexResponse::class);
    }
1001654
public function ToString( $provider = null )
	{
		$result = "";
		if ( $this->S ) $result .= "-";
		if ( $this->IsLocal )
			$result .= $this->Value->format("--m-d");
		else
			if ( $this->Value->getOffset() == 0 )
				$result .= $this->Value->format("--m-d\Z");
			else
				$result .= $this->Value->format("--m-dP");

		return $result;
	}
58236
public static function findByProvider($provider, $identifier)
    {
        $t = UserRemoteIdentity::tableName();

        return self::find()
            ->leftJoin($t, self::tableName().'.[['.self::primaryKey()[0].']]='.$t.'.[[user_id]]')
            ->andWhere($t.'.[[provider]]=:provider', [':provider' => $provider])
            ->andWhere($t.'.[[identifier]]=:identifier', [':identifier' => $identifier])
            ->one();
    }