This commit fixes our unit tests so they also pass against the KeyDB
server. We didn't ned to change all that much. Most of it was just
adding a version/keydb check.
The only change to PhpRedis itself was to relax the reply requirements
for XAUTOCLAIM. Redis 7.0.0 added a third "these elements were recently
removed" reply which KeyDB does not have.
Fixes#2466
Add a mechanism that allows users to specify an arbitrary class name, in
combination with a search path so that PhpRedis unit tests can be run
against a different client.
Additionally, this commit allows multiple classes to be invoked in one
test execution either by passing multiple `--class` arguments, or a
class argument with a comma separated value.
* Implement `ZDIFF`, `ZINTER`, `ZUNION`, `ZMSCORE`, and
`ZRANDMEMBER` for `RedisCluster`.
* Refactor `ZUNIONSTORE` command and switch to using our centralized
zset option parsing handler.
See #1894
* Create inline wrappers of the low-level php_stream_* functions that
also keep track of the number of bytes written/read.
* Change the logic to aggregate network traffic until the user
explicitly "resets" it. I think this will be a more common use-case
(running many commands and then seeing overall network IO).
See #2106
RedisCluster stub fixes
I can now run RedisCluster unit tests within a PHP build tree build in
debug mode without any deprecation warnings or arginfo/zpp errors.
With this commit, I can now run the full `--class Redis` unit test suite
inside of a PHP8.2.x buiild tree and have them pass and not throw any
fatal zpp argument errors.
Rework the session locking unit tests to be less reliant on arbitrary
sleep calls which can be very troublesome when running in Travis and
especially when running in Travis under valgrind.
Additionally, skip multiple newly added Redis 6.2 commands that aren't
yet implemented in RedisCluster.
Fix for #1847 when dealing with NULL multi bulk replies in RedisCluster.
Adds `Redis::OPT_NULL_MULTIBULK_AS_NULL` setting to have PhpRedis
treat NULL multi bulk replies as `NULL` instead of `[]`.
Co-authored-by: Alex Offshore <offshore@aopdg.ru>
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).
Right now cloning the repo and running unit tests will all fail if the
Redis/RedisCluster instances aren't configured with the password
'phpredis'.
This commit simply makes authentication during the tests optional via a
command-line argument.
Adds an option to process the actual strings in simple string replies as
opposed to translating them to `true`. This only applies to
`rawCommand` and `eval` because as far as I know know vanilla Redis
command attaches any information besides `OK` to simple string replies.
Addresses #1550