protected static function create($alias)
    {
        $aliasConfigKey = static::CONFIGURE_KEY_PREFIX . $alias;
        if (!Configure::check($aliasConfigKey)) {
            throw new \InvalidArgumentException('Filesystem "' . $alias . '" not configured');
        }

        if (static::existsAndInstanceOf($aliasConfigKey)) {
            return Configure::read($aliasConfigKey . '.client');
        }

        if (Configure::check($aliasConfigKey . '.factory')) {
            return static::factory(Configure::read($aliasConfigKey . '.factory'));
        }

        if (self::existsAndVarsCount($aliasConfigKey)) {
            return static::adapter(static::read($aliasConfigKey, 'adapter'), static::read($aliasConfigKey, 'vars'));
        }

        if (self::existsWithDsn($aliasConfigKey)) {
            return static::adapterFromDsn(Configure::read($aliasConfigKey. '.url'));
        }

        throw new \InvalidArgumentException(sprintf(static::INVALID_ARGUMENT_MSG, $alias));
    }
protected static function create($alias)
    {
        $aliasConfigKey = static::CONFIGURE_KEY_PREFIX . $alias;
        if (!Configure::check($aliasConfigKey)) {
            throw new \InvalidArgumentException('Filesystem "' . $alias . '" not configured');
        }

        if (static::existsAndInstanceOf($aliasConfigKey)) {
            return Configure::read($aliasConfigKey . '.client');
        }

        if (Configure::check($aliasConfigKey . '.factory')) {
            return static::factory(Configure::read($aliasConfigKey . '.factory'));
        }

        if (self::existsAndVarsCount($aliasConfigKey)) {
            return static::adapter(static::read($aliasConfigKey, 'adapter'), static::read($aliasConfigKey, 'vars'));
        }

        if (self::existsWithDsn($aliasConfigKey)) {
            return static::adapterFromDsn(Configure::read($aliasConfigKey. '.url'));
        }

        throw new \InvalidArgumentException(sprintf(static::INVALID_ARGUMENT_MSG, $alias));
    }
protected static function create ( $ alias ) { $ aliasConfigKey = static :: CONFIGURE_KEY_PREFIX . $ alias ; if ( ! Configure :: check ( $ aliasConfigKey ) ) { throw new \ InvalidArgumentException ( 'Filesystem "' . $ alias . '" not configured' ) ; } if ( static :: existsAndInstanceOf ( $ aliasConfigKey ) ) { return Configure :: read ( $ aliasConfigKey . '.client' ) ; } if ( Configure :: check ( $ aliasConfigKey . '.factory' ) ) { return static :: factory ( Configure :: read ( $ aliasConfigKey . '.factory' ) ) ; } if ( self :: existsAndVarsCount ( $ aliasConfigKey ) ) { return static :: adapter ( static :: read ( $ aliasConfigKey , 'adapter' ) , static :: read ( $ aliasConfigKey , 'vars' ) ) ; } if ( self :: existsWithDsn ( $ aliasConfigKey ) ) { return static :: adapterFromDsn ( Configure :: read ( $ aliasConfigKey . '.url' ) ) ; } throw new \ InvalidArgumentException ( sprintf ( static :: INVALID_ARGUMENT_MSG , $ alias ) ) ; }
Gather the information to build an adapter.

@param string $alias The alias chosen for the adapter we want.

@throws \InvalidArgumentException Thrown when no matching configuration is found.

@return AdapterInterface
Gather the information to build an adapter .