mirror of
https://github.com/predis/predis.git
synced 2026-08-25 21:19:44 +00:00
583b924085
When sending raw commands their arguments are not filtered, responses are not parsed and key prefixes are not applied. The client also does not throw any exception on Redis errors regardless of its settings. The first parameter takes the raw arguments of the command (included its identifier) as defined by the Redis documentation while the second optional parameter is always populated by reference to indicate when Redis actually returned an error response. $client->raw(['PING']); // "PONG" $client->raw(['SET','foo','bar']); // "OK" $client->raw(['GET','foo'], $err); // "bar", $err=FALSE $client->raw(['LPUSH','foo',1], $err); // "WRONGTYPE...", $err=TRUE Internally, this method creates instances of Predis\Command\RawCommand that get passed to the underlying connection instance for execution as if they were usual commands defined by Predis. Raw commands work in both cluster and replication scenarios since they are recognized by their command ID, but key prefixing is not supported since it is done by the profile instance when instantiating commands.