Factory a RedisPubSubAdapter.

@param array $config

@return RedisPubSubAdapter
545186
protected function makeRedisAdapter(array $config)
    {
        if (!isset($config['read_write_timeout'])) {
            $config['read_write_timeout'] = 0;
        }

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

        return new RedisPubSubAdapter($client);
    }
1193688
public static function create(array $config)
    {
        if (\Tripod\Config::getConfig() !== $config) {
            \Tripod\Config::setConfig($config);
        }
        if (isset($config['class']) && class_exists($config['class'])) {
            $tripodConfig = call_user_func(array($config['class'], 'deserialize'), $config);
        } else {
            $tripodConfig = \Tripod\Mongo\Config::deserialize($config);
        }
        return $tripodConfig;
    }
690882
protected function createClient(Repository $config)
    {
        $server     = trim($config['host']);
        $port       = intval($config['port']);
        $timeout    = floatval($config['timeout']);
        $persistent = boolval($config['persistent']);
        $password   = isset($config['password']) ? $config['password'] : '';
        $redis      = new Redis();
        try {

            if ($persistent) {
                $result = $redis->pconnect($server, $port, $timeout);
            } else {
                $result = $redis->connect($server, $port, $timeout);
            }

            if ('' != $password) {
                $result = $redis->auth($password);
            }

            if (false == $result) {
                throw new RedisException("Redis Server can not be connection({$server}:{$port}:{$timeout})");
            }
        } catch(Exception $ex) {
            throw new RedisException($ex->getMessage(), $ex->getCode());
        }

        $redis->_prefix($this->prefix);

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

        return $this->repository(new ApcStore(new ApcWrapper, $prefix));
    }
557379
protected function createClient(array $config)
    {
        return tap(new Redis, function ($client) use ($config) {
            $this->establishConnection($client, $config);

            if (! empty($config['password'])) {
                $client->auth($config['password']);
            }

            if (! empty($config['database'])) {
                $client->select($config['database']);
            }

            if (! empty($config['prefix'])) {
                $client->setOption(Redis::OPT_PREFIX, $config['prefix']);
            }

            if (! empty($config['read_timeout'])) {
                $client->setOption(Redis::OPT_READ_TIMEOUT, $config['read_timeout']);
            }
        });
    }
788592
public function create(array $config)
    {
        $dashboard = new Dashboard();

        foreach ($config as $name => $cfg) {
            $widget = $this->widgetFactory->create($name, $cfg['type'], $cfg['options']);
            $dashboard->addWidget($widget);
        }

        return $dashboard;
    }
486185
public function createContainer(array $config)
    {
        $container = new Container();
        $container->add('config.raw', $config);
        $this->setContainer($container);
        return $this->getContainer();
    }
1365325
public static function client(array $config = []): RedisInterface
	{
		[$hash, $config] = static::getKey($config, 'redis.client');

		if (isset(static::$pool[$hash])) {
			return static::$pool[$hash];
		}

        return static::$pool[$hash] = RedisFactory::client($config);
	}
1273964
protected function createDatabaseRepository(array $config)
    {
        return new DatabaseTokenRepository(
            $this->app['db']->connection($config['connection']),
            $config['table'],
            $this->app['config']['app.key'],
            $config['expires']
        );
    }
76053
public function createFromConfig(array $config)
    {
        $class = key($config);
        $this->checkMappingIsValid($class);

        return new ClassArgumentObject($this->mapping[$class]->getInstance(), $config[$class]);
    }
361861
public static function factory($config)
    {
        // get session storage driver
        $storage = $config->get('session_storage', 'db');

        // class name for this storage
        $class = "rcube_session_" . $storage;

        // try to instantiate class
        if (class_exists($class)) {
            return new $class($config);
        }

        // no storage found, raise error
        rcube::raise_error(array('code' => 604, 'type' => 'session',
                               'line' => __LINE__, 'file' => __FILE__,
                               'message' => "Failed to find session driver. Check session_storage config option"),
                           true, true);
    }
1344182
public function createS3Driver(array $config)
	{
		$s3Config = array_only($config, ['key', 'region', 'secret', 'signature', 'base_url']);

		return $this->adapt(
			new Flysystem(new S3Adapter(S3Client::factory($s3Config), $config['bucket']))
		);
	}
1000944
public static function client(array $config = []): RedisInterface
    {
        $driver = $config['driver'] ?? '';

        if ($driver === 'native' || !PHP_REDIS_EXTENSION) {
            return new Client\Native($config);
        }

        return new Client\PhpRedis($config);
    }
997392
public function createLocalAdapter(array $config)
    {
        $permissions = $config['permissions'] ?? [];
        $root = Yii::getAlias($config['root']);

        $links = ($config['links'] ?? null) === 'skip'
            ? LocalAdapter::SKIP_LINKS
            : LocalAdapter::DISALLOW_LINKS;

        return $this->adapt($this->createFlysystem(new LocalAdapter(
            $root, LOCK_EX, $links, $permissions
        ), $config));
    }
448342
protected function _connection(array $config)
    {
        $redis = new \Redis;
        $host = empty($config['host']) ? self::DEFAULT_HOST : $config['host'];
        $port = empty($config['port']) ? self::DEFAULT_PORT : $config['port'];
        $timeout = empty($config['timeout']) ? self::DEFAULT_TIMEOUT : $config['timeout'];
        $connect = empty($config['persistent']) ? 'connect' : 'pconnect';
        $redis->$connect($host, $port, $timeout);
        return $redis;
    }
865711
public function connect(array $config)
    {
        $auth = $this->getAuth($config);
        $client = $this->getClient($auth);

        return $this->getAdapter($client);
    }
775852
public static function createServiceManager(array $config = [])
    {
        $serviceManager = new ServiceManager(new Config($config));

        $serviceManager->addInitializer(
            function ($instance, ServiceLocatorInterface $serviceLocator) {
                if ($instance instanceof ModelManagerAwareInterface) {
                    $instance->setModelManager($serviceLocator->get('modelmanager'));
                }
            }
        );

        $serviceManager->addInitializer(
            function ($instance, ServiceLocatorInterface $serviceLocator) {
                if ($instance instanceof ServiceLocatorAwareInterface) {
                    $instance->setServiceLocator($serviceLocator);
                }
            }
        );

        return $serviceManager;
    }