Commit Graph

810 Commits

Author SHA1 Message Date
Pavlo Yatsukhnenko 504810a5d1 Issue #2068, Refactor ACL command 2022-11-01 12:53:23 +02:00
michael-grunder f2cef8be06 More docblocks and refactor SLAVEOF command.
Add additional complete docblocks for a few more commands.

Refactor SLAVEOF handler to conform with more modern PhpRedis command
handlers.

Create REPLICAOF and deprecate SLAVEOF as Redis has done since 5.0.0.
2022-10-31 22:32:43 -07:00
Pavlo Yatsukhnenko 2a0d1c1e6d Refactor PubSub command 2022-10-31 17:01:35 -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 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
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 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 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 872ae1079f Implement Redis 7.0.0 [P]EXPIRE[AT] options
See #2068
2022-10-13 11:31:28 -07:00
michael-grunder d05d301b5a Better unix:// or file:// detection.
Fixes #1836
2022-10-13 10:35:54 -07:00
michael-grunder 525958ea9f Implement CONFIG REWRITE
Closes #847
2022-10-10 08:30:37 -07:00
michael-grunder d2044c9fa4 Move where we generate our salt
Fixes #1987
2022-10-08 11:04:05 -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 ab4ce4ab6f Allow negative timeout/read_timeout and fix doc
Co-authored-by: twosee <twose@qq.com>
2022-10-07 11:42:38 -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
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
Remi Collet 3cd5ac1e27 use spl_ce_RuntimeException (exists since 5.6) 2022-07-18 13:46:10 +02:00
Remi Collet 3675f442e4 mark auth param as sensitive for PHP 8.2
refactor MINIT (split in each class sources file)
use @generate-class-entries in stub files
add RedisException and RedisClusterException in stub files
2022-07-18 13:45:45 +02:00
Pavlo Yatsukhnenko df97cc3531 Issue #1894
Add the COUNT argument to LPOP and RPOP
2022-06-07 18:51:55 +03:00
Pavlo Yatsukhnenko e6b3fe5484 Backoff settings in constructor 2022-05-27 15:26:39 +03:00
Pavlo Yatsukhnenko c40f9d6c02 Fix default host length 2022-04-29 16:49:29 +03:00
Pavlo Yatsukhnenko 4b767be7e9 Issue #1894
Add FAILOVER command.
2022-04-23 15:59:26 +03:00
Pavlo Yatsukhnenko 11861d9511 Issue #1894
Add GETEX, GETDEL commands.
2022-04-17 17:57:11 +03:00
Pavlo Yatsukhnenko 55bf0202dd Fix segfault 2022-04-14 21:13:54 +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
Pavlo Yatsukhnenko 0879770a82 Issue #1746 2022-04-05 22:56:25 +03:00
Pavlo Yatsukhnenko dfcf52cab1 Merge pull request #2087 from tillkruss/patch-3
Fix restoring keys when using compression
2022-04-03 21:54:01 +03:00
Pavlo Yatsukhnenko 01f3342c72 Issue #1894
Add XAUTOCLAIM command
2022-03-30 21:01:02 +03:00
Till Krüss 82e08723d0 fix restoring keys when using compression 2022-03-29 21:14:34 -07:00
Pavlo Yatsukhnenko b344649b6f [WIP] Issue #1894
Add geosearch and geosearchstore commands.
2021-12-28 21:17:19 +02:00
Pavlo Yatsukhnenko ee550fb990 Issue #2009 2021-12-13 20:14:26 +02:00
Pavlo Yatsukhnenko 373f78c731 Issue #1733 2021-10-23 22:00:12 +03:00
michael-grunder dfbbc8428a WIP: Experimental support to detect unconsumed data
This commit is an attempt at detecting unconsumed data on a socket when
we pull it from the connection pool.

Two new INI settings are introduced related to the changes:

redis.pconnect.pool_detect_dirty:

Value Explanation
----- ----------------------------------------------------------------
    0 Don't execute new logic at all.
    1 Abort and close the socket if we find unconsumed bytes in the
      read buffer.
    2 Seek to the end of our read buffer if we find unconsumed bytes
      and then poll the socket FD to detect if we're still readable
      in which case we fail and close the socket.

redis.pconnect.pool_poll_timeout:

The poll timeout to employ when checking if the socket is readable.
This value is in milliseconds and can be zero.
2021-09-27 10:15:33 -07:00
Pavlo Yatsukhnenko 6c8cd5c283 Redis::__construct options 2021-09-25 16:03:39 +03:00
Pavlo Yatsukhnenko 7cc15ca209 [WIP] Add stub-based arginfo for Redis 2021-09-02 14:02:44 +03:00
Pavlo Yatsukhnenko eca6278f6a [WIP] Use stub/arginfo for RedisCluster 2021-08-26 09:55:38 +03:00
Pavlo Yatsukhnenko c8ae539523 Use stub/arginfo for RedisArray 2021-08-26 09:53:51 +03:00
Remi Collet 7e621b99da use zend_parse_parameters_none 2021-08-26 09:53:07 +03:00
Remi Collet edac508ef5 use stub/arginfo for RedisSentinel 2021-08-26 09:52:40 +03:00