RedisArray will segfault if you pass something other than strings
into your array of hosts. This is invalid input (needs strings here)
but it shouldn't crash php.
The MGET call in RedisArray was failing under circumstances where
none of the passed keys hashed into any given node in the ring.
What was happening is that RedisArray was passing through to the
phpredis MGET command an empty array, which was returning false.
This in turn caused RedisArray to abort the process and return
false as well.
This change updates RedisArray MGET such that if a given node
doesn't have any keys, we skip the call to it all together.
Addresses #435
Addresses #436
This commit adds a utility method as a counterpart to the _unserialize
utility method, allowing users to manually serialize data themselves
before sending it to Redis. This could be useful for calls going through
EVAL, as phpredis can't automatically serialize/unserialize in that case.
Addresses #431
This commit implements the Redis PUBSUB command, a new command
available since Redis 2.8.0 and described here:
http://redis.io/commands/pubsub
Addresses #427
This commit introduces support for the Redis SCAN, HSCAN, SSCAN,
and ZSCAN commands.
In the case of HSCAN, SSCAN, and ZSCAN, we take a key and iterator
as required arguments, and for SCAN just an iterator. Matching
the Redis commands, each variant can optionally take a pattern
to match against and a count value which hints at Redis how many
keys to return at a time.
When scanning keys or members (especially with a large keyspace when
searching for a pattern), Redis will sometimes return an empty result
of keys/members. PHPRedis can be set up to abstract this from the
caller by setting:
$redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);
Which instructs PHPRedis to keep retrying the scan until members are
returned OR the iteration completes (Redis returns to us a zero iterator).
By default this option is set to Redis::SCAN_NORETRY, meaning that
empty results are possible, requiring an explicit check for FALSE in the
scanning loop, like so:
```php
$it = NULL;
while(($arr_keys = $redis->scan($it, "*pattern*"))!==FALSE) {
print_r($arr_keys);
}
```
This commit implements the new WAIT command which currently lives
in redis unstable, along with a unit test.
Also added myself to the README.markdown file, as well as a link to
"the twitter".