Predis is a flexible and feature-complete PHP client library for Redis. This is a maintenance release for the 0.6 series that mainly features internal optimizations, a more stable support for transactions (MULTI/EXEC) and comes with a bunch of new commands for Redis 2.2-dev. As with previous releases, Predis is also available for PHP 5.2 with an officially supported backport (PHP >= 5.2.6). What follows is an overview of the new features introduced in this new release. For a more in-depth list of changes please see the CHANGELOG.
Support MULTI/EXEC has been internally improved to handle a few corner cases with client-side exceptions and aborted transaction.
Aside from a bunch of new commands added for Redis 2.2 (STRLEN, LINSERT, RPUSHX, LPUSHX, ZREVRANGEBYSCORE, PERSIST) and a couple of fixes for SORT, now WATCH can be also called with an array of keys:
$redis->watch(array('foo', 'bar'));
Method chaining with UNWATCH and DISCARD using Predis\MultiExecBlock has been fixed and now it is possible to do:
$replies = $redis->multiExec(array('watch' => 'foo'))
->set('foo', 'bar')
->unwatch()
->discard()
->set('foo', 'bar')
->execute();