This commit adds initial support for the new GEO commands.
Presently the more complicated GEORADIUS[BYMEMBER] command
doesn't do much post-processing of the response, but will
probably be modified in the future to return it in a more
php friendly way.
Presently, the sAdd command is variadic, meaning that it takes a key
and then 1 to N additional arguments for the members being added. We
need to keep this functionality to avoid breaking existing code,
but there are good performance and other reasons to have an sAdd
command which takes a key followed by an array of members, which is
what the sAddArray method implements.
Rename command to rawCommand() as it's named in phpredis proper
This introspection function will inform the caller what mode phpredis
is in (atomic, pipeline, multi)
Conflicts:
php_redis.h
This commit just backports the newer and improved multi-bulk
processing for various commands (e.g. zrange, hmget,etc) from
develop into feature/redis_cluster
Also modified getbit to treat the value as a long
Implement the new COMMAND command in Redis for both cluster and
non cluster classes. This command is really more of a debug tool
but should actually be useful for updating the unit tests as we
can now simply detect which commands do and don't exist, etc.
Implemented ROLE and TIME commands in RedisCluster, as well as
updated the TIME command for Redis proper such that we use the
new calling convention.
Updated redis_read_variant_reply to take a context void* so it
conforms with the correct prototype.
Implemented the WATCH command for RedisCluster. This command can
take any number of keys, so phpredis splits the request across the
cluster in the best way it can.
For every key in a multiple key command, Redis Cluster requires
that they all hash to the same SLOT, else it will return a
CROSSLOT error and fail.
For WATCH in RedisCluster, a few things to note:
* The command will fail if phpredis is out of sync with the keyspace.
This is because we'll need to know where to deliver each command,
or can't possibly deliver them correctlhy.
* The command will fail if any command delivery failures occur on any
node. This is the case either for a normal communication error or
if RedisCluster returns to us MOVED/ASK redirection.
Implemented ZRANGE and ZREVRANGE for both Redis and cluster.
We can't use generic command processing here as the return type
depends on the optional WITHSCORES bit.
In addition, switched the code around such that zReverseRange is
an alias of zRevRange because ZREVRANGE is the actual Redis
command name.
Each of the commands that take no arguments can be reworked
such that they use the new calling convention in Redis proper
Impelemnted BITPOS
Removed Redis::resetStat. This isn't a Redis method, but rather
an option on CONFIG, and it probably should be called that way.
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.
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).
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).
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
This is the initial commit of the HyperLogLog probabilistic counting
command introduced in Redis.
Support for the following commands is implemented
* PFADD <key> <member1> <member2> ... <memberN>
* PFCOUNT <key>
* PFMERGE <dstkey> <srckey1> <srckey2> ... <srckeyN>