When first creating the pfCount function, I simply allowed for one
string value for the key. Either Redis changed since then, or I
just missed it initially, but the PFCOUNT command can take one or
more keys.
This change doesn't break the API (in case anyone is using it under
develop now) as it can still take a single string argument, or can
take an array.
Redis has actually introduced the "command" command, so it would
be confusing for phpredis to implement arbitrary command processing
as the same function name of an actual Redis command.
This commit changes the behaviour of the various subscribe flavors
such that the callback can break the loop by returning any non-null
value.
This would allow, for example, context to be retreived from the message
and then used in such a way to return it to the caller.
As discovered in issue #523, phpredis was attempting to unserialize
both the keys *and* scores for commands like zRangeByScore. This
had to do with the logic around deserialization in the response.
In addition, this same bug would have caused issues when running
commands like $r->config('get'), because that too, would have tried
to unserialize the values, which we don't want to do.
This commit reworks parsing and zipping up replies by allowing the
call to be configured to unseraialize any combination of keys or
values (or none or both).
For certain error types (Redis LOADING the dataset, SYNC in progress/master down,
and AUTH failures) it may be prudent to throw an exception rather than simply
return false.
In addition, this commit adds logic to reauthorize the connection in the event of
a reconnect (for whatever reason).
Addresses #515
This is a simple addition that allows a client to call any given
Redis command by sending the command name followed by a list of
arguments.
This is useful for the cases where there are new commands in Redis
that have not yet been specifically implemented in phpredis, or
if you want to use phpredis as a pass-through where the commands
and arguments are coming from somewhere else (e.g. monitor logs, etc).
When you instruct phpredis to retry the scan command in the event
of a non zero iterator but zero elements being returned, it was
leaking memory, as it did not free the previous result.
Addresses #501
When you instruct phpredis to retry the scan command in the event
of a non zero iterator but zero elements being returned, it was
leaking memory, as it did not free the previous result.
Addresses #501
This commit adds the command ZRANGEBYLEX to phpredis, which was
introduced in 2.8.9. Like with most commands, phpredis will do
some simple validation on the client side, to avoid sending
calls which are not correct (e.g. min/max that aren't valid
for the call, etc).
Addresses #498 and #465