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 call Predis\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 new connections 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 the curl and the phpiredis 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 to throw_errors and it is a connection parameter instead of a client option, along with iterable_multibulk.
      • key_distribution has been removed from the client options. To customize the distribution strategy you must provide a callable object to the new cluster client option to configure and then return a new instance of Predis\Network\IConnectionCluster.
      • Predis\Client::create() has been removed. Just use the constructor to set up a new instance of Predis\Client.
      • Predis\Client::pipelineSafe() was deprecated in Predis v0.6.1 and now has finally removed. Use Predis\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 with Predis\Network\IConnectionSingle::getResource() so that you can talk directly with Redis.
    • ๐Ÿ”€ The Predis\MultiBulkCommand class has been merged into Predis\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 and Predis\Network\IConnectionCluster.

    • The constructor of Predis\Client now accepts more type of arguments such as instances of Predis\IConnectionParameters and Predis\Network\IConnection.