Make Gaufrette filesystem.

@param array $configs Parameters in filesystems name, injected in gaufrette adapter

@return FilesystemInterface
967952
public function makeFilesystem(array $configs)
    {
        $adapter = $this->getAdapter($configs);

        if (!$adapter instanceof Adapter) {
            throw new \Exception('The adapter must has instance of Gaufrette\Adapter');
        }

        $this->filesystem = new Filesystem($adapter);

        return $this;
    }
1186629
public function build($configs)
    {
        foreach ($configs as $config) {

            $this->config = $config;

            $this->initVars();
            $this->loadColumns();

            $this->buildDataClasses();
            $this->buildMapperClasses();
            $this->generateClasses();
        }

        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
        );
    }
1134500
public function getAdapter(array $configs)
    {
        if ($configs['force_absolute_url'] === true) {
            $this->urlRelative = $this->urlAbsolute;
        }

        return new LocalAdapter($this->path);
    }
31801
public function load(array $files, Config $config = null)
    {
        if (is_null($config)) {
            $config = new Config();
        }

        if (!$this->isValidFileList($files)) {
            throw new \RuntimeException('Invalid config file list given. At least one config file must exist.');
        }

        foreach ($files as $file) {
            if ($this->isFileExisting($file)) {
                $config->merge(
                    $this->loadFile($file)
                );
            }
        }

        return $config;
    }
1114000
public function put($path, $contents, array $config = []) {
        return $this->getFileSystem()->put($path, $contents, $config);
    }
346567
public function make($records, $adapter = null, $config = array())
    {
        $config = array_merge($this->getConfig(), $config);
        $this->setConfig($config);
        $configHelper = new ConfigHelper($this->getConfig());

        if ($adapter) {
            $this->setAdapter($adapter);
        }

        $recordSet = $this->generate($records,$configHelper);
        $infiniteScroll = new InfiniteScroll(new ViewLoader(), $configHelper);

        $linkCreator = new LinkCreator($configHelper, $infiniteScroll);
        $links = $linkCreator->createLinks($recordSet->total());
        $recordSet->setLinks($links);
        return $recordSet;
    }
430113
public static function make(array $config)
    {
        $builder = self::getBuilder();
        $configObject = $builder->build($config);
        $grid = new Grid($configObject);
        return $grid;
    }
292501
public function getAppConfig (array $defaults = array()) {
		$config = $this -> loadConfigFile("config");

		if (!is_array($config)) {
			throw new Exception("Config file must return an array.");
		}

		$config = $this -> arrays -> deepMerge($defaults, $config);
		return new Tree($config, $this -> getAppConfigSchema());
	}
300607
protected function makeGoogleCloudAdapter(array $config)
    {
        $clientConfig = [
            'projectId' => $config['project_id'],
            'keyFilePath' => $config['key_file'],
        ];
        if (isset($config['auth_cache'])) {
            $clientConfig['authCache'] = $this->container->make($config['auth_cache']);
        }

        $client = $this->container->make('pubsub.gcloud.pub_sub_client', ['config' => $clientConfig]);

        $clientIdentifier = array_get($config, 'client_identifier');
        $autoCreateTopics = array_get($config, 'auto_create_topics', true);
        $autoCreateSubscriptions = array_get($config, 'auto_create_subscriptions', true);
        $backgroundBatching = array_get($config, 'background_batching', false);
        $backgroundDaemon = array_get($config, 'background_daemon', false);
        $maxMessages = array_get($config, 'max_messages', 1000);
        $returnImmediately = array_get($config, 'return_immediately', null);
        $returnImmediatelyPause = array_get($config, 'return_immediately_pause', null);

        if ($backgroundDaemon) {
            putenv('IS_BATCH_DAEMON_RUNNING=true');
        }

        return new GoogleCloudPubSubAdapter(
            $client,
            $clientIdentifier,
            $autoCreateTopics,
            $autoCreateSubscriptions,
            $backgroundBatching,
            $maxMessages,
            $returnImmediately,
            $returnImmediatelyPause
        );
    }
1058933
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var \Detail\Gaufrette\Options\ModuleOptions $options */
        $options = $serviceLocator->get('Detail\Gaufrette\Options\ModuleOptions');

        $adapterFactories = $options->getAdapterFactories();
        $adapters = array();

        foreach ($options->getAdapters() as $name => $adapter) {
            /** @var \Detail\Gaufrette\Options\AdapterOptions $adapter */

            if (!isset($adapterFactories[$adapter->getType()])) {
                throw new ConfigException(
                    sprintf('No factory configured for adapter type "%s"', $adapter->getType())
                );
            }

            $adapterFactoryClass = $adapterFactories[$adapter->getType()];

            if (!class_exists($adapterFactoryClass)) {
                throw new ConfigException(
                    sprintf(
                        'Adapter factory class "%s" does not exist for type "%s"',
                        $adapterFactoryClass,
                        $adapter->getType()
                    )
                );
            }

            /** @var \Detail\Gaufrette\Factory\Adapter\AdapterInterface $adapterFactory */
            $adapterFactory = new $adapterFactoryClass();

            $adapters[$name] = $adapterFactory->createAdapter(
                $serviceLocator,
                $adapter->getOptions()
            );
        }

        $filesystems = array();

        foreach ($options->getFilesystems() as $name => $filesystem) {
            /** @var \Detail\Gaufrette\Options\FilesystemOptions $filesystem */

            if (!isset($adapters[$filesystem->getAdapter()])) {
                throw new ConfigException(
                    sprintf('Adapter "%s" does not exist', $filesystem->getAdapter())
                );
            }

            /** @todo Check if adapter is a \Gaufrette\Adapter object */

            $filesystems[$name] = new Filesystem($adapters[$filesystem->getAdapter()]);
        }

        return new FilesystemService($filesystems);
    }
950802
public function driver($driver = '', array $configs = [])
    {
        $driverList = $this->getDriverList();

        if (!count($configs)) {
            $configs = isset($this->getConfig()[$driver]) ? $this->getConfig()[$driver] : [];
        }

        if (isset($driverList[$driver])) {
            $driver = $driverList[$driver];
        }

        if (is_string($driver)) {
            $driver = new $driver;
        }

        return $this->setDriver($driver, $configs);
    }
1288311
public function createFileSystem(array $config)
    {
        if (isset($config[FileUploadConstants::LOCAL_PATH]) === false) {
            throw new InvalidConfigException(FileUploadConstants::LOCAL_PATH);
        }

        $localFilesystem = new Local($config[FileUploadConstants::LOCAL_PATH]);
        $filesystem = new Filesystem($localFilesystem);

        return $filesystem;
    }
133418
public function fs()
    {
        if (null === $this->fs)
            $this->fs = new Filesystem($this->getFilesystemPath(), $this->adapter);
        return $this->fs;
    }
1072846
public function configure(array $config = [])
    {
        // Check if config has defined a tempDir
        if (isset($config['tempDir']) && is_dir($config['tempDir'])) {
            $this->tempDir = $config['tempDir'];
        }

        return $this;
    }
70526
public static function getConfigFiles(array $names, $configDir = null)
    {
        $dirs = ($configDir === null) ? self::getConfigDirs() : [$configDir];

        return self::getRealFiles($dirs, $names);
    }
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;
	}