Commit Graph

525 Commits

Author SHA1 Message Date
michael-grunder
0b7bd83f57 Add more docblocks and fix XAUTOCLAIM response handler.
- Finish adding docblocks with examples for all of the stream commands.
- Fix XAUTOCLAIM response handler (the reply has a slightly different
  structure to XCLAIM.
2022-11-15 23:29:45 -08:00
michael-grunder
450904f75c Documentation: More docblocks with examples. 2022-11-07 18:17:48 -08:00
Pavlo Yatsukhnenko
2a0d1c1e6d Refactor PubSub command 2022-10-31 17:01:35 -07:00
Pavlo Yatsukhnenko
e8f5b51748 Move options to the end list 2022-10-30 12:00:12 -07:00
Pavlo Yatsukhnenko
2bb6403883 Issue #1894
Add the CH, NX, XX arguments to GEOADD
2022-10-30 12:00:12 -07:00
michael-grunder
af13f951aa Fix BITOP cross-slot bug
Fixes #2210
2022-10-27 07:45:08 -07:00
michael-grunder
43da8dd9d8 Refactor BRPOPLPUSH and add B[LR]POP documentation 2022-10-26 18:55:55 -07:00
michael-grunder
dc1f2398d0 TOUCH command
Implement the TOUCH command and refactor several of our "variadic key"
commands, which were previously all using their own specific handlers.

While refactoring the code, I changed `EXISTS` to require one key (it
had previously been set to require zero keys).

Additonally, it looks like we had a disparity in two commands which
should be idential to PhpRedis:  SINTERSTORE and SUNIONSTORE.
Previously, SINTERSTORE required only one argument but SUNIONSTORE 2.

I simply changed SUNIONSTORE to also only require a single argument,
since that argument could be an array.

```php
$redis->sInterStore(['dst', 'src1', 'src2']);
$redis->sUnionStore(['dst', 'src1', 'src2']);
```
2022-10-26 01:38:42 -07:00
michael-grunder
69355faae0 Future proof our igbinary header check
See: #2194
2022-10-24 00:25:20 -07:00
Pavlo Yatsukhnenko
e0a88b7bdf Issue #2106
Expose the transferred number of bytes
2022-10-24 09:18:19 +03:00
Pavlo Yatsukhnenko
d73f3f4b08 Issue #2106 2022-10-24 09:17:22 +03:00
michael-grunder
8c7c5a3aa2 Refactor SORT and add SORT_RO command
See #2068
2022-10-23 13:18:13 -07:00
michael-grunder
1343f50083 XGROUP DELCONSUMER and ENTRIESREAD
Refactor XGROUP and implement the new DELCONSUMER (Redis 6.2.0) and
ENTRIESREAD (Redis 7.0.0) options.  Additionally, add a proper phpdoc
block to the stub file.

See #2068
2022-10-23 11:37:20 -07:00
michael-grunder
71bcbcb973 Implement ZRANGESTORE and add ZRANGE options
* Add ZRANGESTORE command.

* Add Redis 6.2's `REV`, `BYLEX`, and `BYSCORE` to ZRANGE options.

* Refactor several ZRANGE family commands into a single reply and
  options handler, using PHP's new argument parsing macros.

* Extend our tests to use the new ZRANGE options.

See #1894
2022-10-22 12:46:01 -07:00
michael-grunder
f3a408305a EVAL_RO and EVALSHA_RO
Implement Redis 7.0.0's readonly eval variants

See: #2068
2022-10-21 23:35:09 -07:00
michael-grunder
5dcf3f802b Newer versions of Redis shouldn't need a long delay 2022-10-20 15:04:45 -07:00
michael-grunder
d87f142826 Refactor SLOWLOG command
Refactor the slowlog command to use the new argument parsing API and
also change it so we no longer manually handle atomic/non-atomic
logic in the handler itself.
2022-10-19 12:58:39 -07:00
michael-grunder
36ef4bd8d1 Variadic CONFIG GET/SET
Redis 7.0.0 allows for getting and setting multiple config values as an
atomic operation.  In order to support this while maintaining backward
compatibility, the CONFIG command is reworked to also accept an array of
values or keys and values.

See: #2068
2022-10-19 09:15:16 -07:00
michael-grunder
44d03ca00a INFO with multiple sections
See #2068
2022-10-16 11:31:43 -07:00
michael-grunder
4d8afd387e Refactor BITPOS and implement BIT/BYTE option.
Update BITPOS to use the new argument parsing macros as well as
implement Redis 7.0.0's BIT/BYTE modifier.

Additionally I changed `int $bit` to `bool $bit` as its a more
appropriate datatype.

See #2068
2022-10-13 11:53:57 -07:00
michael-grunder
872ae1079f Implement Redis 7.0.0 [P]EXPIRE[AT] options
See #2068
2022-10-13 11:31:28 -07:00
Michael Grunder
e392dd88dd RedisCluster stub fixes (#2183)
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.
2022-10-12 13:16:43 -07:00
michael-grunder
74cf49f554 More redis.stub.php and PHP 8.2 deprecation fixes.
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.
2022-10-11 12:51:30 -07:00
michael-grunder
54a084e51c Refactor FLUSHDB and update docs.
Fixes #2096
2022-10-10 23:04:17 -07:00
michael-grunder
457953f4fe Refactor and fix XPENDING handler
Fixes #2128
2022-10-10 22:57:36 -07:00
michael-grunder
3b0d8b7781 Refactor XINFO handler
Fixes #2119
2022-10-10 22:55:35 -07:00
michael-grunder
525958ea9f Implement CONFIG REWRITE
Closes #847
2022-10-10 08:30:37 -07:00
michael-grunder
46e64277af Suppress a valgrind false positive 2022-10-09 16:15:02 -07:00
michael-grunder
6b34d17fc4 Add new Redis 6.2.0 XTRIM options
Fixes #1961
2022-10-08 11:35:10 -07:00
michael-grunder
9a3fe401dc Implement new RESTORE options
Add the new RESTORE options REPLACE, ABSTTL, FREQ <freq> and IDLETIME <idletime>

Fixes #1410
2022-10-08 10:51:50 -07:00
michael-grunder
6ea978eb72 [B]LMPOP and [B]ZMPOP commands
Implement the new Redis 7.0.0 commands to pop multiple elements from one
or more lists/zsets.

Additionally, remove INTERNAL_FUNCTION_PARAMETERS from the
redis_sock_read_multibulk_reply_zval helper function as it wasn't
actually being used.
2022-10-08 09:23:13 -07:00
michael-grunder
bebd398c67 WIP: Update stubs so the tests pass in strict mode
These changes allow the PHP 8 unit tests to pass even when zpp strict
mode is enabled.

I'm not exactly sure which setting causes the issue, but without these
changes I get many `zpp` errors if I run the tests inside of a PHP build
tree.
2022-10-08 07:50:18 -07:00
michael-grunder
d35e2664bb Relax OBJECT idletime tests to avoid false failures.
Instead of testing that `OBJECT IDLETIME` returns exactly zero after
updating a key in our tests, just make sure PhpRedis returns us some
numeric value.

We can't really test for a specific number of elapsed seconds in CI as
the VMs may be randomly preempted at times beyond our control, causing
the tests to "fail" even though there was no actual failure.
2022-10-03 12:29:52 -07:00
michael-grunder
f5b2a09b34 EXPIRETIME and PEXPIRETIME 2022-10-02 01:33:50 -07:00
michael-grunder
c0e839f6ac LCS command
Implement the Redis 7.0.0 LCS command with tests.
2022-10-01 10:42:23 -07:00
michael-grunder
6430050808 SINTERCARD and ZINTERCARD commands
Implement Redis 7.0.0 commands SINTERCARD and ZINTERCARD.
2022-10-01 10:42:23 -07:00
michael-grunder
239678a03b Implement CONFIG RESETSTAT
Rework the CONFIG command and add RESETSTAT variant.

Fixes #1673
2022-10-01 10:24:53 -07:00
michael-grunder
8746493296 Add back a default switch case for setoption handler
We can't use `EMPTY_SWITCH_DEFAULT_CASE` here as the underlying macro
will actually panic, as it calls `ZEND_UNREACHABLE` under the hood.
2022-10-01 10:03:48 -07:00
michael-grunder
98fda1b870 Make sure we set an error for key based scans
See #1661
2022-09-28 23:18:53 -07:00
michael-grunder
a98605f216 BLPOP with a float timeout
See #2157
2022-09-27 11:35:40 -07:00
Michael Grunder
39a01ac7b5 Return false or NULL on empty lpos response (#2151)
Return false or NULL on empty lpos response

To be consistent with other PhpRedis methods, we should return either
false or NULL when LPOS returns no results, depening on
NULL_MBULK_AS_NULL setting.
2022-09-18 01:21:20 -07:00
Michael Grunder
a3d2f1319d Add 'BIT'/'BYTE' modifier to BITCOUNT + tests (#2149)
BITCOUNT can take a third optional argument ('BIT', or 'BYTE').

Additionally add a specific test for BITCOUNT that tests all of the
legal ways it can be called in PhpRedis.
2022-09-15 01:29:31 -07:00
Pavlo Yatsukhnenko
a8d10291a2 Redis::client command 2022-09-07 22:47:02 +03:00
Pavlo Yatsukhnenko
687a5c7880 Issue #1943
Add lPos command.
2022-08-03 22:28:08 +03:00
Pavlo Yatsukhnenko
e24b0843b3 Fix tests 2022-06-18 19:54:31 +03:00
Pavlo Yatsukhnenko
df97cc3531 Issue #1894
Add the COUNT argument to LPOP and RPOP
2022-06-07 18:51:55 +03:00
Pavlo Yatsukhnenko
a5c41ceb0f Fix tests on Redis 7.0 2022-05-26 16:32:21 +03:00
Pavlo Yatsukhnenko
fe397371ef Issue #1894
Add Redis::hRandField command
2022-04-12 22:00:04 +03:00
Pavlo Yatsukhnenko
947a2d3897 Issue #1894 2022-04-11 21:57:12 +03:00
michael-grunder
0264de1824 A small test for key scanning in RedisArray
See: #2055
2022-01-30 10:21:13 -08:00