@param array $config

@throws DriverNotFound
@return RedisCacheProvider
359844
public function configure($config = [])
    {
        $redisConfig = config('database.redis.' . $config['connection']);

        $this->config = [
            'host'     => $redisConfig['host'],
            'port'     => $redisConfig['port'],
            'database' => $redisConfig['database']
        ];

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

        return $this->cache->driver($name)->getStore();
    }
1310863
protected function callCustomCreator(array $config)
    {
        $driver = $this->customCreators[$config['driver']]($this->app, $config);

        if ($driver instanceof FilesystemInterface) {
            return $this->adapt($driver);
        }

        return $driver;
    }
464831
public function client(array $config)
    {
        $key = $this->getClientKey($config);

        if (isset($this->clients[$key])) {
            return $this->clients[$key];
        }

        return $this->clients[$key] = $this->createClient($config);
    }
241125
protected function createStackDriver(array $config)
    {
        $handlers = [];

        foreach ($config['channels'] ?? [] as $channel) {
            $handlers = \array_merge($handlers, $this->channel($channel)->getHandlers());
        }

        return new Monolog($this->parseChannel($config), $handlers);
    }
1361621
private function createDriver(array $config)
	{
		if (empty($config['driver'])) {
			throw new InvalidStateException('Undefined driver');
		} elseif ($config['driver'] instanceof IDriver) {
			return $config['driver'];
		} else {
			$name = ucfirst($config['driver']);
			$class = "Mva\\Dbm\\Driver\\{$name}\\{$name}Driver";
			return new $class;
		}
	}
789659
public static function getInstance(array $config = array(), DriverInterface $driver = null)
    {
        static $instance = null;

        if (null === $instance) {
            $instance = new static();
        }

        if ($config) {
            $instance->config = $config;
        }

        if ($driver) {
            $instance->driver = $driver;
        }

        return $instance;
    }
988662
public function make(array $config)
    {
        $driver = $this->getDriver($config);

        // First we will check by the server driver type to see if an extension
        // has been registered specifically for that server.
        if (isset($this->serverExtensions[$driver])) {
            $server = call_user_func($this->serverExtensions[$driver], $config);
        }

        // Create a built-in server with given driver type.
        elseif (method_exists($this, $method = 'create'.Str::studly($driver).'Driver')) {
            $server = $this->$method($config);
        }

        // Otherwise, if the driver type does not support, an exception will be thrown.
        else {
            throw new InvalidArgumentException("Driver [{$driver}] is not supported.");
        }

        $this->configureServer($server, $config);

        return $server;
    }
258725
protected function createApcDriver(array $config)
    {
        $prefix = $this->getPrefix($config);

        return $this->repository(new ApcStore(new ApcWrapper, $prefix));
    }
511496
public function connect(array $config)
    {
        return new RedisQueue(
            $this->redis, $config['queue'],
            Arr::get($config, 'connection', $this->connection),
            Arr::get($config, 'retry_after', 60),
            Arr::get($config, 'block_for', null)
        );
    }
722372
protected static function addRedirectUriToServiceConfig(array $config)
    {
        if (!empty($config['constructor']) && is_array($config['constructor'])) {
            $key = key($config['constructor']); // Key may be non-numeric

            if (!isset($config['constructor'][$key]['redirectUri'])) {
                $config['constructor'][$key]['redirectUri'] = static::getRedirectUri();
            }
        }

        return $config;
    }
330858
public function getDriver($driver = null, array $config = [])
    {
        $driver = strtolower($driver);

        if (!isset($this->drivers[$driver])) {
            $this->drivers[$driver] = $this->createDriver($driver, $config);
        }

        return $this->drivers[$driver];
    }
613778
protected function createSingleDriver(array $config)
    {
        return new Monolog($this->parseChannel($config), [
            $this->prepareHandler(
                new StreamHandler($config['path'], $this->level($config))
            ),
        ]);
    }
819571
protected function makeRedisAdapter(array $config)
    {
        if (!isset($config['read_write_timeout'])) {
            $config['read_write_timeout'] = 0;
        }

        $client = $this->container->makeWith('pubsub.redis.redis_client', ['config' => $config]);

        return new RedisPubSubAdapter($client);
    }
152380
public function connect(array $config)
    {
        $queue = new RedisQueue(
            $this->redis, $config['queue'], array_get($config, 'connection', $this->connection)
        );

        $queue->setExpire(array_get($config, 'expire', 60));

        return $queue;
    }
930396
protected function createMemcachedDriver(array $config)
    {
        $prefix = $this->getPrefix($config);

        // Extract Plus features from config
        $persistentConnectionId = array_get($config, 'persistent_id');
        $customOptions = array_get($config, 'options', []);
        $saslCredentials = array_filter(array_get($config, 'sasl', []));

        $memcached = $this->app['memcached.connector']->connect(
            $config['servers'],
            $persistentConnectionId,
            $customOptions,
            $saslCredentials
        );

        return $this->repository(new MemcachedStore($memcached, $prefix));
    }
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 ) );
	}