RedisArray example



namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;

/** * @group integration */
class RedisArraySessionHandlerTest extends AbstractRedisSessionHandlerTestCase
{
    protected function createRedisClient(string $host): \RedisArray
    {
        return new \RedisArray([$host]);
    }
}
/** * @group integration */
class RedisArrayAdapterTest extends AbstractRedisAdapterTestCase
{
    public static function setUpBeforeClass(): void
    {
        parent::setupBeforeClass();
        if (!class_exists(\RedisArray::class)) {
            throw new SkippedTestSuiteError('The RedisArray class is required.');
        }
        self::$redis = new \RedisArray([getenv('REDIS_HOST')]['lazy_connect' => true]);
        self::$redis->setOption(\Redis::OPT_PREFIX, 'prefix_');
    }
}
throw new SkippedTestSuiteError('The RedisArray class is required.');
        }
        try {
            (new \Redis())->connect(...explode(':', getenv('REDIS_HOST')));
        } catch (\Exception $e) {
            throw new SkippedTestSuiteError($e->getMessage());
        }
    }

    protected function getRedisConnection(): \RedisArray
    {
        return new \RedisArray([getenv('REDIS_HOST')]);
    }
}
throw new SkippedTestSuiteError('The RedisArray class is required.');
        }
        try {
            (new \Redis())->connect(...explode(':', getenv('REDIS_HOST')));
        } catch (\Exception $e) {
            throw new SkippedTestSuiteError($e->getMessage());
        }
    }

    protected function getRedisConnection(): \RedisArray
    {
        $redis = new \RedisArray([getenv('REDIS_HOST')]);

        return $redis;
    }
}
Home | Imprint | This part of the site doesn't use cookies.