Age | Commit message (Collapse) | Author |
|
Add support for Redis 6 ACLs in the `Redis`, `RedisCluster`, and `RedisArray` classes.
On a related note, it adds a mechanism for users to customize how we generate persistent connection IDs such that they can be grouped in different ways depending on the specific use case required (e.g. it would allow connections to be grouped by username, or by user-defined persistent_id, or both).
|
|
|
|
|
|
Addresses #1563
|
|
|
|
This commit updates ZPOPMIN/ZPOPMAX to return the same format that
zRange WITHSCORES and zRangeByScore WITHSCORES does.
In addition the blocking variants BZPOPMIN and BZPOPMAX are implemented.
|
|
This addresses #1502, #1487
|
|
Streams API
|
|
Handle async parameter for Redis::flushDb and Redis::flushAll
TODO: implementation for RedisArray and RedisCluster
|
|
* Adds the STORE and STOREDIST options to GEORADIUS[BYMEMBER] for
both Redis and RedisCluster classes. We attempt to protect the
caller from CROSSLOT errors on the client side so as to make it
obvious when that is happening.
* Created a struct to carry around GEORADIUS options as there are
now two more and there were already a lot.
* Moved the structs/enums to handle GEORADIUS into the source file
instead of header as they aren't needed outside of redis_commands.c
|
|
|
|
|
|
Fix PHP_METHOD syntax fail for unlink
Move redis_unlink_cmd by redis_del_cmd as they're the same
|
|
This commit implements UNLINK for Redis, RedisCluster, and RedisArray.
To a client library UNLINK behaves identically to DEL so we can use the
same handlers for both.
|
|
Move building `script` command logic to `redis_build_script_cmd`
and use it in Redis and RedisCluster objects.
Fix arginfo for `RedisCluster::script`.
Fix memory leak in `cluster_raw_cmd` when `cluster_cmd_get_slot` fails.
|
|
Fixes #1223
|
|
This commit moves EVAL and EVALSHA command construction to our
redis_commands.c file because as with many other commands we
can share the logic between Redis and RedisCluster.
In addition it removes the last call to the legacy formatting
function redis_cmd_format() which can now be removed.
|
|
This commit adds a new printf like command construction function
with additionaly format specifiers specific to phpredis. Because
phpredis can be configured to automatically prefix keys and/or
automatically serialize values we had a great deal of redundant
boilerplate code.
zend_parse_paramaters(..., "sz", &key, &keylen, &z_arg);
keyfree = redis_key_prefix(redis_sock, &key, &keylen);
valfree = redis_serialize(redis_sock, z_val, &realval, &reallen);
/* More processing */
if (keyfree) efree(key);
if (valfree) efree(val);
Now it is possible to use redis_spprintf and use format specifiers
specific to these tasks, which will handle prefixing or serialization
(as well as memory cleanup) automatically:
/* The library function will automatically prefix and serialize values
if phpredis has been configured to do that */
len = phpredis_spprintf(redis_sock, slot TRMLS_CC, "SET", "kv", key,
key_len, z_value);
|
|
|
|
|
|
Redefine zend_get_parameters_array macro for working with `zval *` instead of `zval **`
|
|
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 ZREMRANGEBYLEX in Redis and RedisCluster, and made the
zlexcount command generic, as it has the same semantics.
|
|
Implemented ZREVRANGEBYLEX for Redis and RedisCluster, and made
command construction a generic that can handle either.
|
|
Implemented ZLEXCOUNT for both Redis and RedisCluster.
Removed unused variable in INFO response processor
|
|
Implemented ZRANGEBYLEX for both Redis and RedisCluster
|
|
Implemented HSCAN, SSCAN, and ZSCAN for cluster
|
|
Implemented the two unsubscribe commands in Redis Cluster.
Presently, like with the standard Redis class once you subscribe
you're there for good, but it would be nice to be able to use the
callback return value to break out of the subscribe loop.
|
|
Implemented SUBSCRIBE and PSUBSCRIBE for Redis Cluster. Currently
Cluster will send publish messages to every node, so we can subscribe
wherever we like.
|
|
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.
|
|
Added distribution option to RedisCluster in preperation for
implementation of commands which can be distributed by the client.
The two distribution modes will be:
* DIST_OOE : Maintain order of execution
* DIST_SPEED : Most efficient delivery
Either way, the RedisCluster object will need to return values that
were gathered in the same way they were sent in, but might execute
them in a different order if the option is set to DIST_SPEED.
|
|
Implemented various introspection/option commands for both Redis
and RedisCluster.
Commands implemented:
* getOption
* setOption
* _prefix
* _serialize
* _unserialize
With these implemented, we can properly test RedisCluster with things
like serialization and prefixing turned on.
|
|
Implemented a new version of generic_multiple_args_command which
is slightly simpler, avoiding trying to do everything (including
different commands with keys, or keys/values) and only operating
on keys. The other methods have been implemented differently.
Implemented DEL for Redis proper. Cluster DEL will need to be
a special kind of command where the client splits the request
to various nodes.
|
|
Implemented the OBJECT command for both Redis and Redis Cluster
|
|
Implemented ZADD command for both Redis and RedisCluster
|
|
Implemented HDEL command for both Redis and RedisCluster objects
|
|
Added a generic command routine where we take a key and then a
variable number of arguments. This works for stuff like LPUSH,
RPUSH, SADD, SREM, and the like...
Implemented LPUSH/RPUSH
|
|
Implemented ZUNIONSTORE and ZINTERSTORE in a generic way that
works for both cluster and Redis proper.
|
|
Implemented ZRANGEBYSCORE and ZREVRANGEBYSCORE in the new way for
both Redis and RedisCluster objects. In addition, ZRANGE and
ZREVRANGE handling is nearly identical to "BYSCORE" variants, so
made this generic.
|
|
Implemented SORT command in a new way (using a zval array to construct
each argument, then creating the command from that), as well as updated
Redis proper and RedisCluster to use it.
|
|
Implemented ZINCRBY command
|
|
Implemented SRANDMEMBER command for Redis and RedisCluster
|
|
Implemented HSET and HSETNX commands
|