Predis v0.7.0 Release Notes
Release Date: 2011-12-11 // over 12 years ago-
Predis now adheres to the PSR-0 standard which means that there is no more a single file holding all the classes of the library, but multiple files (one for each class). You can use any PSR-0 compatible autoloader to load Predis or just leverage the default one shipped with the library by requiring the
Predis/Autoloader.php
and callPredis\Autoloader::register()
.0๏ธโฃ The default server profile for Redis is now 2.4. The
dev
profile supports all the features of Redis 2.6 (currently unstable) such as Lua scripting.๐ Support for long aliases (method names) for Redis commands has been dropped.
๐ Redis 1.0 is no more supported. From now on Predis will use only the unified protocol to serialize commands.
It is possible to prefix keys transparently on a client-level basis with the new
prefix
client option.An external connection factory is used to initialize new connection instances and developers can now register their own connection classes using the new
connections
client option.It is possible to connect locally to Redis using UNIX domain sockets. Just use
unix:///path/to/redis.sock
or a named array just like in the following example:array('scheme' => 'unix', 'path' => '/path/to/redis.sock');
.If the
phpiredis
extension is loaded by PHP, it is now possible to use an alternative connection class that leverages it to make Predis faster on many cases, especially when dealing with big multibulk replies, with the the only downside that persistent connections are not supported. Please refer to the documentation to see how to activate this class using the newconnections
client option.Predis is capable to talk with Webdis, albeit with some limitations such as the lack of pipelining and transactions, just by using the
http
scheme in in the connection parameters. All is needed is PHP with thecurl
and thephpiredis
extensions loaded.Way too many changes in the public API to make a list here, we just tried to make all the Redis commands compatible with previous releases of v0.6 so that you do not have to worry if you are simply using Predis as a client. Probably the only breaking changes that should be mentioned here are:
throw_on_error
has been renamed tothrow_errors
and it is a connection parameter instead of a client option, along withiterable_multibulk
.key_distribution
has been removed from the client options. To customize the distribution strategy you must provide a callable object to the newcluster
client option to configure and then return a new instance ofPredis\Network\IConnectionCluster
.Predis\Client::create()
has been removed. Just use the constructor to set up a new instance ofPredis\Client
.Predis\Client::pipelineSafe()
was deprecated in Predis v0.6.1 and now has finally removed. UsePredis\Client::pipeline(array('safe' => true))
.Predis\Client::rawCommand()
has been removed due to inconsistencies with the underlying connection abstractions. You can still get the raw resource out of a connection withPredis\Network\IConnectionSingle::getResource()
so that you can talk directly with Redis.
๐ The
Predis\MultiBulkCommand
class has been merged intoPredis\Command
and thus removed. Serialization of commands is now a competence of connections.The
Predis\IConnection
interface has been splitted into two new interfaces:Predis\Network\IConnectionSingle
andPredis\Network\IConnectionCluster
.The constructor of
Predis\Client
now accepts more type of arguments such as instances ofPredis\IConnectionParameters
andPredis\Network\IConnection
.