PhpRedis.php in Redis 7.2
File
lib/Redis/Client/PhpRedis.php
View source
<?php
class Redis_Client_PhpRedis implements Redis_Client_Interface {
public function getClient($host = NULL, $port = NULL, $base = NULL, $password = NULL, $socket = NULL) {
$client = new Redis();
if (!empty($socket)) {
$client
->connect($socket);
}
else {
$client
->connect($host, $port);
}
if (isset($password)) {
$client
->auth($password);
}
if (isset($base)) {
$client
->select($base);
}
$client
->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE);
return $client;
}
public function getName() {
return 'PhpRedis';
}
}