Create an instance of the Redis cache driver.

@return \Nova\Cache\RedisStore
427610
protected function createRedisDriver()
    {
        $redis = $this->app['redis'];

        return $this->repository(new RedisStore($redis, $this->getPrefix()));
    }
391000
protected function connect()
    {
        // We want to only create the driver once.
        if ($this->driver) {
            return $this;
        }

        $this->driver = new \Memcached();

        $this->driver->setOption(\Memcached::OPT_COMPRESSION, false);
        $this->driver->setOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE, true);

        return $this;
    }
1155627
private function getRedis() {
        if (is_null($this->Redis)) {
            if ($this->isConfigured()) {
                $this->Redis = new \Redis();
                $this->connect();
            } else {
                throw new RedisNotConfiguredException();
            }
        }
        return $this->Redis;
    }
1095456
protected function createCacheDriver($name)
    {
        $config = Arr::get($this->config, "cache.{$name}", []);
        $cache  = $this->getCacheRepository($config);

        return $this->createProvider(new Cache($name, $config, $cache));
    }
496227
protected function createCacheHandler($driver)
    {
        $minutes = $this->app['config']['session.lifetime'];

        return new CacheBasedSessionHandler($this->app['cache']->driver($driver), $minutes);
    }
1098611
public function registerCacheService()
    {
        $this->app->singleton('cache', function ($app) {
            return new Cache($app['config']);
        });

        $this->app->alias('cache', Cache::class);
    }
983844
public function create()
    {
        $instance = self::createStoreCreditPayment($this);
        $this->setId($instance->getId());
        return $instance;
    }
1315795
protected function createCacheHandler( $driver )
	{
		return new CacheBasedSessionHandler( clone CacheManager::i()->driver( $driver ), Config::get( $this->configPrefix . '.lifetime' ) );
	}
973839
public function create()
    {
        foreach ($this->driverClasses as $driverClass) {
            try {
                $driver = new $driverClass();

                return $driver;
            } catch (\Exception $e) {
            }
        }

        return null;
    }
828479
public function create()
    {
        $instance = self::createFixedRateShipping($this);
        $this->setId($instance->getId());
        return $instance;
    }
554086
public function create()
    {
        $instance = self::createStoreCredit($this);
        $this->setId($instance->getId());
        return $instance;
    }
1260539
protected function createCache()
    {
        try {
            if (isset($this->parameters[SessionParameter::CACHE_CLASS])) {
                $cache = new $this->parameters[SessionParameter::CACHE_CLASS];
            } else {
                $cache = $this->createDefaultCacheInstance();
            }

            if (!($cache instanceof CacheProvider)) {
                throw new \RuntimeException(
                    sprintf(
                        'Class %s does not subclass %s!',
                        get_class($cache),
                        CacheProvider::class
                    ),
                    1408354124
                );
            }

            return $cache;
        } catch (\Exception $exception) {
            throw new CmisInvalidArgumentException(
                'Unable to create cache: ' . $exception,
                1408354123
            );
        }
    }
387398
protected function getDriversFromStorage()
    {
        if ($this->cache->has(self::$cacheKey)) {
            return $this->cache->get(self::$cacheKey, []);
        }
        $options = Component::findOneByName('api')->options;

        $drivers = array_get($options, 'auth_drivers');

        $this->cache->put(self::$cacheKey, $drivers);

        return $drivers;
    }
1107343
public function cache_driver()
	{
		if ( ! $this->_cache)
		{
			$adapter = new DCache_Adapter\File(
				realpath(__DIR__.'../../../'.static::CACHE_DIR)
			);
			$adapter->setOption('ttl', static::CACHE_LIFETIME);
			$this->_cache = new DCache\Cache($adapter);
		}

		return $this->_cache;
	}
697234
public function getStore()
    {
        if (null != $this->store) {
            return $this->store;
        }

        switch($this->config['driver']) {
            case "memcached":
                $this->store   = $this->createMemcachedStore();
                break;
            case "redis":
                $this->store   = $this->createRedisStore();
                break;
            default:
                throw new CacheException("store [{$this->config['driver']}] not supported.");
        }

        return $this->store;
    }
885892
protected function createRedisStore()
    {
        $serverArray    = $this->config['servers'];
        $persistent     = boolval($this->config['persistent']);
        $prefix         = trim($this->config['prefix']);

        if ($persistent) {
            foreach ($serverArray as $k => $v) {
                $v['persistent']    = true;
                $serverArray[$k]    = $v;
            }
        }

        $redisServer    = new RedisServer($serverArray);
        return new RedisStore($redisServer, $prefix);
    }
360163
public static function createStore($connection)
    {
        if (
            $connection instanceof \Redis ||
            $connection instanceof \RedisArray ||
            $connection instanceof \RedisCluster ||
            $connection instanceof \Predis\Client ||
            $connection instanceof RedisProxy ||
            $connection instanceof RedisClusterProxy
        ) {
            return new RedisStore($connection);
        }
        if ($connection instanceof \Memcached) {
            return new MemcachedStore($connection);
        }
        if ($connection instanceof \Zookeeper) {
            return new ZookeeperStore($connection);
        }
        if (!\is_string($connection)) {
            throw new InvalidArgumentException(sprintf('Unsupported Connection: %s.', \get_class($connection)));
        }

        switch (true) {
            case 'flock' === $connection:
                return new FlockStore();
            case 0 === strpos($connection, 'flock://'):
                return new FlockStore(substr($connection, 8));
            case 'semaphore' === $connection:
                return new SemaphoreStore();
            case \class_exists(AbstractAdapter::class) && preg_match('#^[a-z]++://#', $connection):
                return static::createStore(AbstractAdapter::createConnection($connection));
            default:
                throw new InvalidArgumentException(sprintf('Unsupported Connection: %s.', $connection));
        }
    }