Get / set hybridauth adapter instance.

@param \Hybrid_Provider_Model $adapter Hybrid auth adapter instance
@return \Hybrid_Provider_Model|void
508494
public function adapter($adapter = null)
    {
        if ($adapter === null) {
            return $this->_adapter;
        }

        $this->_adapter = $adapter;
    }
850639
public function addAdaptor(AbstractAdaptor $adaptor)
    {
        // The key will be the adaptor's name or the next numerical
        // count if a name is blank
        $adaptorName = $adaptor->getName() ?: $this->adaptorCount;
        $this->adaptors[$adaptorName] = $adaptor;
        $this->adaptorCount++;
    }
18221
public function plugIn($adaptee)
    {
        if (is_array($adaptee)) {
            foreach ($adaptee as $item) {
                $this->plugIn($item);
            }

            return $this;
        }

        $this->collection->push($this->connectAdapter($adaptee));

        return $this;
    }
1037353
public function setAdapter($options = null)
    {
        if (is_string($options)) {
            $adapter = $options;
        } elseif (isset($options['adapter'])) {
            $adapter = $options['adapter'];
            unset($options['adapter']);
        } else {
            $adapter = 'BlockCipher';
        }

        if (!is_array($options)) {
            $options = [];
        }

        if (class_exists('Zend\Filter\Encrypt\\' . ucfirst($adapter))) {
            $adapter = 'Zend\Filter\Encrypt\\' . ucfirst($adapter);
        } elseif (!class_exists($adapter)) {
            throw new Exception\DomainException(
                sprintf(
                    '%s expects a valid registry class name; received "%s", which did not resolve',
                    __METHOD__,
                    $adapter
                )
            );
        }

        $this->adapter = new $adapter($options);
        if (!$this->adapter instanceof Encrypt\EncryptionAlgorithmInterface) {
            throw new Exception\InvalidArgumentException(
                "Encoding adapter '" . $adapter
                . "' does not implement Zend\\Filter\\Encrypt\\EncryptionAlgorithmInterface"
            );
        }

        return $this;
    }
13223
protected function createAdapter(string $adapter, array $config): Adapter
    {
        if ($adapter === 'Local') {
            if (! isset($config['config']['path'])) {
                throw new RuntimeException('Filesystem local adapter must set `path`');
            }

            $config = [$config['config']['path']];
        }

        return Reflection::newInstance(
            'One\\FileSystem\\Adapters\\' . $adapter,
            $config
        );
    }
1131838
protected final function createAuthManager(array $options = [], IAuthAdapter $adapter = null, IAuthStorage $storage = null)
    {
        return $this->getAuthFactory()
            ->createManager($options, $adapter, $storage);
    }
103910
public function setAdapter($adapter)
    {
        if ($adapter == null) {
            $this->adapter = $adapter;
        } else {
              parent::setAdapter($adapter);
        }
    }
621113
public function injectAdapter(AdapterInterface $adapter, ?string $name = null): self
    {
        if (null === $name) {
            $name = get_class($adapter);
        }

        $this->logger->debug('inject auth adapter ['.$name.'] of type ['.get_class($adapter).']', [
            'category' => get_class($this),
        ]);

        if ($this->hasAdapter($name)) {
            throw new Exception\AdapterNotUnique('auth adapter '.$name.' is already registered');
        }

        $this->adapter[$name] = $adapter;

        return $this;
    }
875246
private function getAuthProviderConfig($authProvider)
    {
        // have we already fetched the auth config
        if ($this->authProviderConfig) {
            return $this->authProviderConfig;
        }

        if ($authProvider == '') {
            // get the first auth provider from the list
            $providers = $this->getConfig()->get('AuthenticationProviders', []);
            $authProvider = $providers[0];
        }

        $this->authProviderConfig = Security::getConfig()->get('AuthenticationProviders.' . $authProvider, new ConfigObject());

        // merge the internal driver
        // merge only if driver is not set and it matches the internal auth provider name
        if (!$this->authProviderConfig->get('Driver', false) && isset(self::$authProviders[$authProvider])) {
            $this->authProviderConfig->mergeWith(['Driver' => self::$authProviders[$authProvider]]);
        }

        // make sure the requested auth provider is assigned to the current firewall
        if (!in_array($authProvider, $this->getConfig()->get('AuthenticationProviders', [])->toArray())) {
            throw new FirewallException('Authentication provider "' . $authProvider . '" is not defined on "' . $this->getFirewallKey() . '" firewall.');
        }

        // check that we have the driver
        if (!$this->authProviderConfig->get('Driver', false)) {
            throw new FirewallException('Unable to detect configuration for authentication provider "' . $authProvider . '".');
        }

        $this->authProviderName = $authProvider;

        return $this->authProviderConfig;
    }
1286701
public function getWriteConnection(AdapterInterface $adapter = null)
    {
        if (null === $this->connection) {
            $this->connection = ConnectionFactory::create($this->configuration, $adapter);
            $this->connection->setName($this->getName());
        }

        return $this->connection;
    }
98779
protected function decorateWithCachedAdapter(AdapterInterface $adapter, array $config)
    {
        if (
            ($cacheDriver = Arr::get($config, 'driver', false)) !== false &&
            (is_a($cacheDriver, 'League\Flysystem\Cached\CacheInterface') ||
                class_exists($driverName = Arr::get($this->cacheDrivers, $cacheDriver, $cacheDriver))
            )
        ) {
            if (isset($driverName)) {
                switch ($driverName) {
                    case 'League\Flysystem\Cached\Storage\Adapter':
                        $cacheDriver = new \League\Flysystem\Cached\Storage\Adapter($this->disk(Arr::get($config, 'disk', 'local'))->getAdapter(), Arr::get($config, 'file', 'flysystem.cache'), Arr::get($config, 'expire', null));
                        break;
                    case 'Madewithlove\IlluminatePsrCacheBridge\Laravel\CacheItemPool':
                        $cacheDriver = new \League\Flysystem\Cached\Storage\Psr6Cache(new \Madewithlove\IlluminatePsrCacheBridge\Laravel\CacheItemPool($this->app->make(\Illuminate\Contracts\Cache\Repository::class)), Arr::get($config, 'key', 'flysystem'), Arr::get($config, 'expire', null));
                        break;
                    case 'League\Flysystem\Cached\Storage\Memcached':
                        if (class_exists('Memcached')) {
                            $memcached = new \Memcached;
                            $memcached->addServer(Arr::get($config, 'host', 'localhost'), Arr::get($config, 'port', 11211));

                            $cacheDriver = new \League\Flysystem\Cached\Storage\Memcached($memcached, Arr::get($config, 'key', 'flysystem'), Arr::get($config, 'expire', null));
                        } else {
                            return $adapter;
                        }
                        break;
                    case 'League\Flysystem\Cached\Storage\Memory':
                        $cacheDriver = new \League\Flysystem\Cached\Storage\Memory;
                        break;
                    case 'League\Flysystem\Cached\Storage\Noop':
                        $cacheDriver = new \League\Flysystem\Cached\Storage\Noop;
                        break;
                    case 'League\Flysystem\Cached\Storage\PhpRedis':
                    case 'League\Flysystem\Cached\Storage\Predis':
                        $cacheDriver = new \League\Flysystem\Cached\Storage\Predis(\Illuminate\Support\Facades\Redis::connection(Arr::get($config, 'connection', 'default')), Arr::get($config, 'key', 'flysystem'), Arr::get($config, 'expire', null));
                        break;
                    case 'League\Flysystem\Cached\Storage\Stash':
                        if (class_exists('Stash\Pool')) {
                            if (($backend = Arr::get($config, 'backend', false)) !== false && (is_a($backend, 'Stash\Interfaces\DriverInterface') || class_exists($backend))) {
                                if (is_a($backend, 'Stash\Interfaces\DriverInterface')) {
                                    $backendInstance = $backend;
                                } else {
                                    $backendInstance = new $backend;
                                    $backendInstance->setOptions(Arr::get($config, 'options', []));
                                }

                                $pool = new \Stash\Pool($backendInstance);
                            } else {
                                $pool = new \Stash\Pool;
                            }

                            $cacheDriver = new \League\Flysystem\Cached\Storage\Stash($pool, Arr::get($config, 'key', 'flysystem'), Arr::get($config, 'expire', null));
                        } else {
                            return $adapter;
                        }
                        break;
                    default:
                        return $adapter;
                }
            }

            return new \League\Flysystem\Cached\CachedAdapter($adapter, $cacheDriver);
        } else {
            return $adapter;
        }
    }
76627
public function setOptions($options)
    {
        if ($this->options !== $options) {
            if (!$options instanceof AdapterOptions) {
                $options = new AdapterOptions($options);
            }

            if ($this->options) {
                $this->options->setAdapter(null);
            }
            $options->setAdapter($this);
            $this->options = $options;
        }

        return $this;
    }
1250214
private function bindJwtAuthProvider()
    {
        $this->app->singleton('revisionable.userprovider', function ($app) {
            $field = $app['config']->get('sofa_revisionable.userfield');

            return new Adapters\JwtAuth($app['tymon.jwt.auth'], $field);
        });
    }
966517
public function getConnectedProviders() {
		$hybridAuthProviders = $this->hybridAuth->getConnectedProviders();

		$providers = $this->makeProviders($hybridAuthProviders);

		return $providers;
	}
1102945
private function getAdapter(string $adapter = null, array $params, SymfonyStyle $inputOutput): Adapter
    {
        $adapterName = $adapter ?? $inputOutput->askQuestion(new AdapterChoice());
        $adapterName = strtolower($adapterName);

        if (empty($params)) {
            $questionGenerator = new AdapterQuestionProvider();
            foreach ($questionGenerator->getQuestionsFor($adapterName) as $question) {
                $params[] = $inputOutput->askQuestion($question);
            }
        }

        return $this->adapterFactory->build($adapterName, $params);
    }
765937
public static function setAdapter($adapter)
    {
        switch (strtolower($adapter)) {
            case 'sodium':
                $adapterSet = '\Zest\Encryption\Adapter\SodiumEncryption';
                break;
            case 'openssl':
                $adapterSet = '\Zest\Encryption\Adapter\OpenSslEncryption';
                break;
            default:
                $adapterSet = '\Zest\Encryption\Adapter\OpenSslEncryption';
                break;
        }
        $key = __config()->encryption->key;
        self::$adapter = new $adapterSet($key);

        return __CLASS__;
    }
826542
private static function executeAdapter($adapter, Request $request, array $config = null)
    {
        if (!in_array('Embed\\Adapters\\AdapterInterface', class_implements($adapter))) {
            throw new \InvalidArgumentException("The class '$adapter' must implements 'Embed\\Adapters\\AdapterInterface'");
        }

        if (call_user_func([$adapter, 'check'], $request)) {
            return new $adapter($request, $config);
        }

        return false;
    }