Skip to content

Predis\Client Connection #2

@LeMoussel

Description

@LeMoussel

Hi,

How can I use an Predis\Client connection to my Redis backend that I've established earlier?

For example, here's how I connect for other Redis uses:

// Opening a Persistent Connections to Redis
$parameters = [
        'scheme'     => 'tcp',
        'host'       => 'REDIS_HOST',
        'port'       => 'REDIS_POST',
        'password'   => 'REDIS_PWD',
        'persistent' => '1'
        ];
$options = ['cluster' => 'redis'];
$redisClient = new Predis\Client($parameters, $options);

If I pass an instance of Predis\Client to the init method like this: $persistence = JuanF\Lib\Persistence\Redis::init($redisClient); I got an exception Fatal error: Class 'Redis' not found

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions