0

When I talk to redis directly I can use Redis::OPT_PREFIX to ensure i'm not overwriting keys. e.g. namespacing ..

    $redis = new Redis();
    if ($redis->connect('127.0.0.1', 6379)) {
        $redis->setOption(Redis::OPT_PREFIX, 'FooBar9000:');
        if ($redis->exists($hash)) {

I'm also using phpFastCache V6 connecting to the Redis driver into which you can throw a config:

$InstanceCache = CacheManager::getInstance('redis', new Config([
 'host' => '127.0.0.1', //Default value
 'port' => 6379, //Default value
 'password' => null, //Default value
 'database' => null, //Default value
]));

but I can seem to see how I can set options on that driver?

1 Answer 1

0

Yes and no...

This is natively not possible but as of the v7 you can provide your own Redis client: https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV4%CB%96%5D-Configuration-Options#redispredis-specific-options

So in the meantime that they add the support for this option you can make use of your own Redis client.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.