Create an instance of the DynamoDB cache driver.

@param  array  $config
@return \Illuminate\Cache\Repository
343191
protected function createDynamodbDriver(array $config)
    {
        $dynamoConfig = [
            'region' => $config['region'],
            'version' => 'latest',
        ];

        if ($config['key'] && $config['secret']) {
            $dynamoConfig['credentials'] = Arr::only(
                $config, ['key', 'secret', 'token']
            );
        }

        return $this->repository(
            new DynamoDbStore(
                new DynamoDbClient($dynamoConfig),
                $config['table'],
                $config['attributes']['key'] ?? 'key',
                $config['attributes']['value'] ?? 'value',
                $config['attributes']['expiration'] ?? 'expires_at',
                $this->getPrefix($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 ) );
	}
492132
public static function create($config)
    {

        $clientBuilder = ClientBuilder::create();

        if (!empty($config['handler'])) {
            $clientBuilder->setHandler($config['handler']);
        }

        $clientBuilder->setHosts($config["servers"]);

        $clientBuilder = self::configureLogging($clientBuilder,$config);

        $query = new Query($clientBuilder->build());

        if (array_key_exists("index", $config) and $config["index"] != "") {
            $query->index($config["index"]);
        }

        return $query;
    }
1142142
protected function getMemcachedHandler(array $config)
    {
        // Create new memcached instance
        $memcached = $this->app->make(Memcached::class, [
            'CCM_SESSION',
            null,
        ]);

        $servers = array_get($config, 'servers', []);

        // Add missing servers
        foreach ($this->newMemcachedServers($memcached, $servers) as $server) {
            $memcached->addServer(
                array_get($server, 'host'),
                array_get($server, 'port'),
                array_get($server, 'weight')
            );
        }

        // Return a newly built handler
        return $this->app->make(MemcachedSessionHandler::class, [
            $memcached,
            ['prefix' => array_get($config, 'name') ?: 'CCM_SESSION'],
        ]);
    }
558733
protected function createLogDriver(array $config)
    {
        $logger = $this->app->make('Psr\Log\LoggerInterface');

        return new LogBroadcaster($this->app, $logger);
    }
905337
public static function load(array $config) {
		assert(key_exists("cache_path", $config), "Cache path not set.");
		assert(key_exists("db", $config), "Database config not set");

		$db_conf = $config['db'];

		$ormMemcache = Persistence\OrmMemcache::init($config['cache_path']);

		$dsn = 'mysql:host=' . $db_conf['host'] . ';dbname=' . $db_conf['db'];
		$options = [
			PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8MB4'",
			PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
		];
		$pdo = new PDO($dsn, $db_conf['user'], $db_conf['pass'], $options);

		$database = Persistence\Database::init($pdo);
		$databaseAdmin = Persistence\DatabaseAdmin::init($pdo);

		DependencyManager::addDependency($ormMemcache);
		DependencyManager::addDependency($database);
		DependencyManager::addDependency($databaseAdmin);
	}
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;
		}
	}
413855
protected function createRedisDriver(array $config)
    {
        $connection = Arr::get($config, 'connection');

        // Create a Redis Database instance.
        $redis = $this->app->make('redis');

        return new RedisBroadcaster($this->app, $redis, $connection);
    }
671390
public static function createFromConfig(array $config)
    {
        $manager = static::createEmptyFromConfig($config);

        $manager->addCollection(new CssCollection)
                ->addCollection(new JavascriptCollection);

        return $manager;
       
    }
1191699
public function createService(Config $config)
    {
        $options = $config->getCacheOptions();

        $storage = new FileSystem($options->getStorageOptions());

        return $storage;
    }
675411
public function connect(array $config)
    {
        return new DatabaseQueue(
            $this->connections->connection($config['connection'] ?? null),
            $config['table'],
            $config['queue'],
            $config['retry_after'] ?? 60
        );
    }
391358
protected function getCacheRepository(array $config)
    {

        $connection = Arr::get($config, 'connections.cache');
        return $this->app->make('cache')->driver($connection);
    }
1208451
public function make(array $config): SearchClient
    {
        $config = $this->getConfig($config);

        return $this->getClient($config);
    }
489853
protected function registerCache($cacheConfig)
    {
        switch ($cacheConfig['driver']) {
            case 'filesystem':
                $cacheDriver = new FilesystemCache($cacheConfig['dir']);
                break;
            default:
                $cacheDriver = new FilesystemCache(sys_get_temp_dir());
        }

        return $cacheDriver;
    }
782386
public function createDriver($driver, array $config = [])
    {
        $driver = strtolower($driver);

        $queueConfig = new Structure($config);

        if (!$queueConfig->toArray()) {
            throw new \LogicException('No queue config for ' . $driver);
        }

        // TODO: All driver should have DI pattern.
        switch ($driver) {
            case 'sqs':
                return new SqsQueueDriver(
                    $queueConfig->get('key'),
                    $queueConfig->get('secret'),
                    $queueConfig->get('queue', 'default'),
                    [
                        'region' => $queueConfig->get('region', 'us-west-2'),
                        'version' => $queueConfig->get('version', 'latest'),
                    ]
                );

            case 'sync':
                return new SyncQueueDriver();

            case 'database':
                return new DatabaseQueueDriver(
                    $this->container->get('db'),
                    $queueConfig->get('queue', 'default'),
                    $queueConfig->get('table', 'queue_jobs')
                );

            case 'pdo':
                return new PdoQueueDriver(
                    $this->container->get('db')->getConnection(),
                    $queueConfig->get('queue', 'default'),
                    $queueConfig->get('table', 'queue_jobs')
                );

            case 'ironmq':
                return new IronmqQueueDriver(
                    $queueConfig->get('project_id'),
                    $queueConfig->get('token'),
                    $queueConfig->get('queue', 'default'),
                    [
                        'host' => $queueConfig->get('region', 'mq-aws-us-east-1-1') . '.iron.io',
                    ]
                );

            case 'rabbitmq':
                return new RabbitmqQueueDriver(
                    $queueConfig->get('queue', 'default'),
                    (array) $queueConfig->toArray()
                );

            case 'resque':
                return new ResqueQueueDriver(
                    $queueConfig->get('host', 'localhost'),
                    $queueConfig->get('port', '6379'),
                    $queueConfig->get('queue', 'default')
                );

            case 'beanstalkd':
                return new BeanstalkdQueueDriver(
                    $queueConfig->get('host', '127.0.0.1'),
                    $queueConfig->get('queue', 'default'),
                    $queueConfig->get('timeout', 60)
                );

            default:
                return new NullQueueDriver();
        }
    }
1143159
public function createConnector(array $config)
    {
        if (!isset($config['driver'])) {
            throw new InvalidArgumentException('A driver must be specified.');
        }

        if ($this->container->has($key = "db.connector.{$config['driver']}")) {
            return $this->container->get($key);
        }

        switch ($config['driver']) {
            case 'mysql':
                return new MySqlConnector;
            case 'pgsql':
                return new PostgresConnector;
            case 'sqlite':
                return new SQLiteConnector;
            case 'sqlsrv':
                return new SqlServerConnector;
        }

        throw new InvalidArgumentException("Unsupported driver [{$config['driver']}]");
    }
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));
    }