Registers an adapter instance.

@param  \mako\gatekeeper\adapters\AdapterInterface $adapter Adapter instance
@return string
553612
protected function registerAdapterInstance(AdapterInterface $adapter): string
	{
		$this->adapters[$name = $adapter->getName()] = $adapter;

		return $name;
	}
105171
public function setAdapter($adapter)
    {
        if (\is_callable($adapter)) {
            $adapter = \call_user_func($adapter, $this->container);
        }

        $this->adapter = $adapter;
    }
774590
public function authenticate( AdapterInterface $adapter = null )
    {
        $result = parent::authenticate( $adapter );

        if ( $result->isValid() )
        {
            $this->identityRefreshed = true;
        }

        return $result;
    }
401734
static public function isAvailableAdapter($adapter)
    {
        $adapter = strtolower($adapter);
        $result  = false;
        $type    = null;

        $pdoAdapters = (class_exists('Pdo', false)) ? \PDO::getAvailableDrivers() : array();
        if (strpos($adapter, 'pdo_') !== false) {
            $type    = substr($adapter, 4);
            $adapter = 'pdo';
        }

        switch ($adapter) {
            case 'mysql':
            case 'mysqli':
                $result = (class_exists('mysqli', false));
                break;
            case 'oci':
            case 'oracle':
                $result = (function_exists('oci_connect'));
                break;
            case 'pdo':
                $result = (in_array($type, $pdoAdapters));
                break;
            case 'pgsql':
                $result = (function_exists('pg_connect'));
                break;
            case 'sqlite':
                $result = (class_exists('Sqlite3', false));
                break;
            case 'sqlsrv':
                $result = (function_exists('sqlsrv_connect'));
                break;
        }

        return $result;
    }
486051
public static function addAdapter(AnLoaderAdapterInterface $adapter)
    {
        self::$_adapters[$adapter->getType()] = $adapter;
        self::$_prefix_map[$adapter->getPrefix()] = $adapter->getType();
    }
752278
public function setAdapter($adapter)
    {
        if (!is_string($adapter) && !$adapter instanceof ConversionAlgorithmInterface) {
            throw new Exception\InvalidArgumentException(sprintf(
                '"%s" expects a string or an instance of ConversionAlgorithmInterface; received "%s"',
                __METHOD__,
                is_object($adapter) ? get_class($adapter) : gettype($adapter)
            ));
        }
        if (is_string($adapter)) {
            if (!class_exists($adapter)) {
                throw new Exception\RuntimeException(sprintf(
                    '"%s" unable to load adapter; class "%s" not found',
                    __METHOD__,
                    $adapter
                ));
            }
            $adapter = new $adapter();
            if (!$adapter instanceof ConversionAlgorithmInterface) {
                throw new Exception\InvalidArgumentException(sprintf(
                    '"%s" expects a string representing an instance of ConversionAlgorithmInterface; received "%s"',
                    __METHOD__,
                    is_object($adapter) ? get_class($adapter) : gettype($adapter)
                ));
            }
        }
        $this->adapter = $adapter;

        return $this;
    }
862903
protected function applyAdapterProfileToExistingProfile($adapter_profile, $profile)
	{
		$attributes = get_object_vars($adapter_profile);

		foreach ($attributes as $k => $v)
		{
			$profile->$k = $v;
		}

		return $profile;
	}
1363648
public function getAdapter($name)
    {
        if (!isset($this->adapters[$name])) {
            throw new Exception\ConnectionException(
                "Adapter " . $name . " not registered on connection!"
            );
        }

        return $this->adapters[$name];
    }
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;
    }
307448
public function setAdapter(AdapterInterface $adapter)
    {
        $this->adapter = $adapter;
        $this->connection = new Connection($this->adapter);
    }
382884
public function createIdentity(AdapterInterface $adapter): IdentityInterface
    {
        $map = new $this->attribute_map_class($adapter->getAttributeMap(), $this->logger);
        $this->identity = new $this->identity_class($adapter, $map, $this->logger);

        return $this->identity;
    }
130634
public function setAdapter($alias, AdapterInterface $adapter)
    {
        $this->adapters->set($alias, $adapter);
        return $this;
    }
723477
public static function getImplementationForAdapter($adapter)
    {
        if (!isset(self::$cacheAdapters[$adapter])) {
            $classname = __NAMESPACE__.'\\'.ucfirst($adapter);
            self::$cacheAdapters[$adapter] = new $classname();
        }
        return self::$cacheAdapters[$adapter];
    }
1078097
protected function _loadAclAdapter($adapter) {
		if (!class_exists($adapter)) {
			throw new Exception(sprintf('The Acl Adapter class "%s" was not found.', $adapter));
		}

		$adapterInstance = new $adapter();
		if (!($adapterInstance instanceof AclAdapterInterface)) {
			throw new InvalidArgumentException(sprintf(
				'TinyAuth Acl adapters have to implement %s.', AclAdapterInterface::class
			));
		}

		return $adapterInstance;
	}
1295429
public function get($name)
    {
        if (!isset($this->adapters[$name])) {
            throw new \InvalidArgumentException(sprintf('No Adapter with name "%s" is registered.', $name));
        }

        return $this->adapters[$name];
    }
1257802
public function get($alias)
    {
        if (!array_key_exists($alias, $this->adapters)) {
            throw new \InvalidArgumentException(sprintf('There is no adapter registered under that alias: "%s"', $alias));
        }

        return $this->adapters[$alias];
    }
738691
public static function config($adapter, $options = []) {
		$_this = static::getInstance();

		if (!empty($adapter) && !empty($options)) {
			return $_this->_adapterConfig[$adapter] = $options;
		}

		if (isset($_this->_adapterConfig[$adapter])) {
			return $_this->_adapterConfig[$adapter];
		}

		return false;
	}