This is a maintenance release for the 0.8 series. What follows is an overview of the changes and bug fixes introduced in this release, more details are available in the CHANGELOG.
New features
Redis commands
- Added the profile alias
3.0
for Redis 3.0, but2.8
is still the default one. - Added
COMMAND
to the server profile for Redis 2.8. This command is actually available since Redis 2.8.13 so it will return a-ERR
when executed against older versions of Redis.
Redis Cluster
The new default for redis-cluster when the client receives a -MOVED
response is to fetch an updated slots map automatically from the node target of the persistent redirection. Thanks to this change you can now feed the client constructor with only a few of the nodes in your cluster without the need to use a more complex configuration, so even if your cluster have - let's say - 10 nodes you can still use only a couple or more connection parameters:
$client = new Predis\Client(
["tcp://10.0.0.1:6379", "tcp://10.0.0.1:6380"],
["cluster" => "redis"]
);
Internally the client fetches the slots map using the new CLUSTER SLOTS
command made available since Redis 3.0.0b7, which means your nodes must be upgraded to the most recent beta release of Redis (but you should do it anyway since it is beta software).
PubSub
Implemented PING
in our PUB/SUB loop abstraction for Redis >= 3.0.0b8. You can now ping the connection with an optional payload directly from the loop instance, and receive back a PONG
message:
foreach ($pubSubLoop as $message) {
switch ($message->kind) {
case "subscribe":
$pubSubLoop->ping("hello!");
break;
case "pong":
echo "Pong message with payload $message->payload\n";
break;
}
}
Bug fixes
- The patch applied in
v0.8.6
to fix #180 introduced a regression affecting read/write timeouts inPredis\Connection\PhpiredisStreamConnection
so we had to apply a further fix which, unfortunately, absolutely requires PHP 5.4+ meaning that read/write timeouts will be ignored from now on PHP 5.3.