Get the local adapter.

@param string[] $config

@return \League\Flysystem\Adapter\Local
11910
protected function getAdapter(array $config)
    {
        // Pull parameters from config and set defaults for optional values
        $path = $config['path'];
        $writeFlags = array_get($config, 'write_flags', LOCK_EX);
        $linkHandling = array_get($config, 'link_handling', Local::DISALLOW_LINKS);
        $permissions = array_get($config, 'permissions', []);

        return new Local($path, $writeFlags, $linkHandling, $permissions);
    }
1110482
public function load(array $config)
    {
        $config = $this->getParsedConfig(
            $config,
            $this->config,
            $this->yamlConfigMap,
            $this->required
        );
        $this->setParsedConfig($config);

        return $this;
    }
485162
private function resolveAdapter($name, $configs)
	{
		try{
			$adatperClass = $this->app->get('\TitaPHP\Filesystem\\'.ucfirst($name).'Adapter');
		}
		catch(NotFoundException $e){
			throw new \Exception("Filesystem driver {$name} could not be located");
		}

		$adapter = $adatperClass->adapt($configs);

		if (!$adapter instanceof \League\Flysystem\AdapterInterface)
			throw new \Exception('Adapter must be instance of \League\Flysystem\AdapterInterface');

		return $adapter;
	}
1041946
public function config($config)
    {
        if (is_array($config)) {
            $this->config = array_merge($this->config, $config);
        } elseif (isset($this->config[$config])) {
            return $this->config[$config];
        } else {
            return;
        }
    }
1291944
final public static function getInstance($config = array())
    {
        static $instance;

        if ($instance === NULL)
        {
            if(!$config instanceof KObjectConfig) {
                $config = new KObjectConfig($config);
            }

            $instance = new self($config);
        }

        return $instance;
    }
441343
public function loadConfig($config = null)
    {
        $config =
            !is_null($config) || !file_exists($this->configFile)
                ? $this->setConfigFile($this->getConfigFile($config))
                : $this->configFile;

        return $this->loadToLaravelConfig($config);
    }
1158155
protected function getClient(array $config)
    {
        $name = array_get($config, 'connector');

        return $this->cache->driver($name)->getStore();
    }
318368
protected function getOptionsFromConfig(Config $config)
    {
        $options = $this->options;

        if ($visibility = $config->get('visibility')) {
            // For local reference
            $options['visibility'] = $visibility;
            // For external reference
            $options['ACL'] = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? 'public-read' : 'private';
        }

        if ($mimetype = $config->get('mimetype')) {
            // For local reference
            $options['mimetype'] = $mimetype;
            // For external reference
            $options['ContentType'] = $mimetype;
        }

        foreach (static::$metaOptions as $option) {
            if ( ! $config->has($option)) {
                continue;
            }
            $options[$option] = $config->get($option);
        }

        return $options;
    }
1145643
private function getCacheInstance(array $config)
    {
        if (!isset($config['enable']) || !$config['enable']) {
            return null;
        }

        $className = $config['adapter'];
        if (!class_exists($className)) {
            $errMsg = sprintf('Adapter "%s" is not supported for caching', $config['adapter']);
            throw new Exception\RuntimeException($errMsg);
        }
        return new $className($config['options']);
    }
449673
public static function getInstance($config = array())
    {
        static $instance;

        if ($instance === null) {
            if (!$config instanceof AnConfig) {
                $config = new AnConfig($config);
            }

            $instance = new self($config);
        }

        return $instance;
    }
498316
public static function getAdapter($config = null) {
		if (is_string($config)) {
			$config = Yesf::app()->getConfig('connection.' . $config);
		}
		if (!isset($config['adapter'])) {
			throw new ConnectionException("Unknown adapter");
		}
		$type = $config['adapter'];
		// Get connection
		$connection = Pool::get($config);
		$hash = spl_object_hash($connection);
		if (!isset(self::$created_adapter[$hash])) {
			if (isset(self::$adapter[$type])) {
				$className = self::$adapter[$type];
			} else {
				throw new ConnectionException("Unknown adapter");
			}
			$instance = new $className($connection);
			self::$created_adapter[$hash] = $instance;
			return $instance;
		} else {
			return self::$created_adapter[$hash];
		}
	}
104763
public function createOssAdapter(array $config)
    {
        $root = $config['root'] ?? null;
        $oss = new OssClient($config['access_id'], $config['access_secret'], $config['endpoint'],
            $config['isCName'] ?? false,
            $config['securityToken'] ?? null,
            $config['proxy'] ?? null
        );
        $oss->setTimeout($config['timeout'] ?? 3600);
        $oss->setConnectTimeout($config['connectTimeout'] ?? 10);
        $oss->setUseSSL($config['useSSL'] ?? false);
        return $this->adapt($this->createFlysystem(
            new OssAdapter($oss, $config['bucket'], $root), $config
        ));
    }
120354
protected function normalizeConnectionConfig(array $config)
    {
        $adapter = $this->createConfigurationAdapter($config['driver']);

        $configuration = new ConnectionConfiguration($adapter);

        return $configuration->map($config);
    }
1172806
protected function getDsn(array $config)
    {
        // First we will create the basic DSN setup as well as the port if it is in
        // in the configuration options. This will give us the basic DSN we will
        // need to establish the PDO connections and return them back for use.
        if ($this->prefersOdbc($config)) {
            return $this->getOdbcDsn($config);
        }

        if (in_array('sqlsrv', $this->getAvailableDrivers())) {
            return $this->getSqlSrvDsn($config);
        } else {
            return $this->getDblibDsn($config);
        }
    }
603525
protected function createFlysystem(AdapterInterface $adapter, array $config)
    {
        if (class_exists('League\Flysystem\EventableFilesystem\EventableFilesystem')) {
            $fsClass = \League\Flysystem\EventableFilesystem\EventableFilesystem::class;
        } else {
            $fsClass = \League\Flysystem\Filesystem::class;
        }

        if (class_exists('League\Flysystem\Cached\CachedAdapter')) {
            $adapter = $this->decorateWithCachedAdapter($adapter, Arr::get($config, 'cache', []));
        }

        $config = Arr::only($config, ['visibility']);

        return new $fsClass($adapter, count($config) > 0 ? $config : null);
    }
792217
public function createNullDriver(array $config)
    {
        return $this->adapt($this->createFlysystem(new \League\Flysystem\Adapter\NullAdapter, $config));
    }
135465
public function createS3Driver( array $config )
	{
		$s3Config = $this->formatS3Config( $config );

		$root = isset( $s3Config['root'] ) ? $s3Config['root'] : null;

		$options = isset( $config['options'] ) ? $config['options'] : [];

		return $this->adapt( $this->createFlysystem( new S3Adapter( new S3Client( $s3Config ), $s3Config['bucket'], $root, $options ), $config ) );
	}