This relates to a previous hotfix for issue #379 where phpredis
would time out if you sent an array of empty values. The reason
it was timing out is that the argument count being sent wasn't
reflecting any skipped items in the array (meaning redis was
waiting for the rest of the command).
I realized that the previous fix would still fail if you were to
send some valid values, with invalid (null, empty string, etc)
ones mixed in.
Presently, we're just skipping invalid items in the array but there
might be a case to issue a php_error_docref type warning when we
encounter them, so the user can know that it happened.
In addition, HMGET now uses a smart_str to build the command, which
means the time it takes to build the key will scale in a linear fashion
When using the TTL command, Redis >= 2.8 will return -1 for a key
with no TTL and -2 for a key that doesn't exist. This fixes the
unit tests so they don't expect this in versions < 2.8.
Implement the new SET options as per the redis documentation:
http://redis.io/commands/set
You can now pass the new options (ex=>sec, px=>milisec, xx, nx) as
an array of options to the SET command and phpredis will handle them.
If you pass key, value, <long> phpredis will still redirect to SETEX
as it did before (to avoid breaking implementations).
Addresses #364
This commit adds methods to get information about the state
of our phpredis object, such as what host/port we are connected
to, our timeout, etc...
The following methods have been added:
getHost()
getPort()
getDBNum()
getTimeout()
getReadTimeout()
isConnected()
getPersistentID()
getAuth()
In addition, there is a small memory leak fix when a persistent id
was specifically passed to connect() (it wasn't beeing freed).
Addresses issue #320
This commit adds support for the CLIENT commands (list, getname,
setname, kill).
You can call them like so:
$redis->client('list');
$redis->client('getname');
$redis->client('setname', $name);
$redis->client('kill', $ip_port);
Solves issue #300
continue to destroy and reallocate the command buffer
Added a simply library routine to append to a command buffer
using a smart_str
Made the unit tests work even if you're not compiled with
igbinary
Addresses issue #287
Adds support for the new COUNT argument to SRANDMEMBER. If called
without a count, we will still return a string response (with one
randome member from the set, or false on a failure/type error).
If the count argument is passed, we return instead an array up to
the number asked for, given how Redis will process this value.
http://redis.io/commands/srandmember