- Added support for Relay (#1263)
- Added support for
FCALL_ROcommand (#1191) - Added support for Redis
JSON,Bloom,SearchandTimeSeriesmodule (#1253) - Added support for
ACL SETUSER, GETUSER, DRYRUNcommands (#1193)
- Fixed prefixes for
XTRIMandXREVRANGEcommands (#1230) - Fix
fclose()being called on invalid stream resource (#1199) - Fix
BitByteandExpireOptionstraits skip processing on null values (#1169) - Fix missing
@returnannotations (#1265)
- Added stream commands to
KeyPrefixProcessor(#1051) - Added
ReplicationStrategy::$loadBalancingoption to disable replica reads (#1168) - Added support for
FCALLandFUNCTIONScommands (#1049) - Added support for
PEXPIRETIMEcommand (#1031) - Added support for
EXPIRETIMEcommand (#1029) - Added support for
EVAL_ROcommand (#1032) - Added support for
LCScommand (#1035) - Added support for
SORT_ROcommand (#1044) - Added support for
SINTERCARDcommand (#1027) - Added support for
EVALSHA_ROcommand (#1034) - Added support for new arguments for
BITPOSandBITCOUNTcommands (#1045) - Added support for new arguments for
EXPIREandEXPIREATcommands (#1046)
- Fixed deprecated function call syntax
- Further deprecated phpiredis and webdis integration (#1179)
- Applied coding standards
- Pass PHPStan level 2
- Fix
@templateinPredis\Client(#1017) - Fix support options array in
ZINTERSTOREandZUNIONSTORE(#1018)
- Deprecated phpiredis and webdis connections
- Implemented
GETEXcommand (#872) - Implemented
GETDELcommand (#869) - Implemented
COPYcommand (#866) - Implemented
FAILOVERcommand (#875) - Implemented
LMOVEcommand (#863) - Implemented
LMPOPcommand (#1013) - Implemented
HRANDFIELDcommand (#870) - Implemented
SMISMEMBERcommand (#871) - Implemented
ZMPOPcommand (#831) - Implemented
BLMOVEcommand (#865) - Implemented
BLMPOPcommand (#1015) - Implemented
BZMPOPcommand (#833) - Implemented
BZPOPMINcommand (#862) - Implemented
BZPOPMAXcommand (#864) - Implemented
ZUNIONcommand (#860) - Implemented
ZINTERcommand (#859) - Implemented
ZINTERCARDcommand (#861) - Implemented
ZRANGESTOREcommand (#829) - Implemented
ZDIFFSTOREcommand (#828) - Implemented
ZDIFFcommand (#826) - Implemented
ZRANDMEMBERcommand (#825) - Implemented
ZMSCORE(#823) - Implemented
GEOSEARCHcommand (#867) - Implemented
GEOSEARCHSTOREcommand (#873)
- Added annotations to suppress PHP 8.1 return type deprecation warning (#810)
- Added mixin annotations for traits (#835)
- Improved PHP 8.2 support
- Call
is_resource()before reading/writing - Added partial support for Redis Stream commands
- Fixed Sentinel authentication issue
- Fixed PHP 8.2 deprecation notice: Use of "static" in callables
- Added retry interval to
RedisClusterwith a default of10ms - Avoid PHP 8.2 warning in
Connection\Parameters - Fixed Sentinel reconnect issue in long-running PHP processes
-
Dropped support for PHP 7.1 and older
-
Accepted values for some client options have changed, this is the new list of accepted values:
aggregate: callable returning an aggregate connection.cluster: string value (predis,redis), callable returning an aggregate connection.replication: string value (predis,sentinel), callable returning an aggregate connection.commands: command factory, named array mapping command IDs to PHP classes, callable returning a command factory or a named array.connections: connection factory, callable object returning a connection factory, named array mapping URI schemes to PHP classes, string identifying a supported combination of configurations for the connection factory.prefix: string value, command processor, callable.exceptions: boolean.
Note that both the
clusterandreplicationoptions now return a closure acting as initializer instead of an aggregate connection instance. -
The
connectionsclient option now accepts certain string values identifying certain combinations of configurations for the connection factory. Currently this is used to provide a short way to configure Predis to load our phpiredis based connection backends simply, accepted values are:phpiredis-streammapsPhpiredis\Connection\PhpiredisStreamConnectiontotcp,redis,unixURI schemes.phpiredis-socketmapsPhpiredis\Connection\PhpiredisSocketConnectiontotcp,redis,unixURI schemes.phpiredis-streamis simply an alias ofphpiredis-stream.
-
Added the new
Predis\Cluster\Hash\PhpiredisCRC16class using ext-phpiredis to speed-up the generation of the CRC16 hash of keys for redis-cluster. Predis automatically uses this class when ext-phpiredis is loaded, but it is possible to configure the hash generator using the newcrc16client option (accepted valuespredis,phpiredisor an hash generator instance). -
Replication backends now use the
roleparameter instead ofaliasin order to distinguish the role of a connection. Accepted values aremaster,slaveand, for redis-sentinel,sentinel. This led to a redesign of how connections can be retrieved from replication backends: the method getConnectionById() now retrieves a connection only by its ID (ip:port pair), to get a connection by its alias there is the new method getConnectionByAlias(). This method is not supported by the redis-sentinel backend due to its dynamic nature (connections are retrieved and initialized at runtime from sentinels) but it is possible to get a single connection from the pool by using its ID. It is also possible to retrieve a connection by role using the method getConnectionByRole(). -
The concept of connection ID (ip:port pair) and connection alias (the
aliasparameter) inPredis\Connection\Cluster\PredisClusterhas been separated. This change does not affect distribution and it is safe for existing clusters. -
Client option classes now live in the
Predis\Configuration\Optionnamespace. -
Classes for Redis commands have been moved into the new
Predis\Command\Redisnamespace and each class name mirrors the respective Redis command ID. -
The concept of server profiles is gone, the library now uses a single command factory to create instances of commands classes. The
profileoption has been replaced by thecommandsoption acceptingPredis\Command\FactoryInterfaceto customize the underlying command factory. The default command factory class used by Predis isPredis\Command\RedisFactoryand it still allows developers to define or override commands with their own implementations. In addition to that,Predis\Command\RedisFactoryrelies on a convention-over-configuration approach by looking for a suitable class with the same name as the command ID in thePredis\Command\Rediswhen the internal class map does not contain a class associated. -
The method
Predis\Client::getClientFor($connectionID)has been replaced bygetClientBy($selector, $value, $callable = null)which is more flexible as it is not limited to picking a connection from the underlying replication or cluster backend by ID, but allows users to specify a$selectorthat can be eitherid(the old behavior),key,slotorcommand. The client uses duck-typing instead of type-checking to verify that the underlying connection implements a method that matches the specified selector which means that some selectors may not be available to all kinds of connection backends. -
The method
Predis\Client::getConnectionById($connectionID)has been removed. -
Changed the signature for the constructor of
Predis\Command\RawCommand. -
The
Predis\Connection\Aggregatenamespace has been split into two separate namespaces for cluster backends (Predis\Connection\Cluster) and replication backends (Predis\Connection\Replication). -
The method
Predis\Connection\AggregateConnectionInterface::getConnection()has been renamed togetConnectionByCommand(). -
The methods
switchToMaster()andswitchToSlave()have been promoted to be part ofPredis\Connection\Replication\ReplicationInterfacewhile the methodswitchTo($connection)has been removed from it. -
The method
Predis\Connection\Cluster\PredisCluster::executeCommandOnNodes()has been removed as it is possible to achieve the same by iterating over the connection or, even better, over the client instance in order to execute the same command against all of the registered connections. -
The class
Predis\CommunicationExceptionnow uses the correct default types for the$message(string) and$code(integer) parameters. -
The method
onConnectionError()inPredis\Connection\AbstractConnectionclass now passes the second argument as an integer value0as its default value instead ofnull. -
Support Pub/Sub and Pipelines when using replication
-
The class
Predis\Transaction\AbortedMultiExecExceptionnow uses the correct default types for the$code(integer) parameter. -
FIX: using
strvalingetScanOptions()method, part ofPredis\Collection\Iterator\CursorBasedIteratorto make sure we retrieve the string value of$this->matchand not passingnulltostrlen()function. -
FIX: the value returned from
getArgument()inisReadOperation()method, part ofPredis\Replication\ReplicationStrategyclass, is checked to not passnulltosha1function. -
FIX: the value returned from
getArgument()inparseResponse()method, part ofPredis\Command\Redis\SENTINELclass, is checked to not passnulltostrtolower()function.
Same as v2.0.0