375 Commits

Author SHA1 Message Date
Pavlo Yatsukhnenko ee210f86e5 Fix security alerts 2022-04-13 18:30:38 +03:00
Pavlo Yatsukhnenko 36457555d4 Fix NULL-pointer dereferences and handle possible UB 2022-04-13 16:18:29 +03:00
Pavlo Yatsukhnenko fe397371ef Issue #1894
Add Redis::hRandField command
2022-04-12 22:00:04 +03:00
Pavlo Yatsukhnenko 750b6cf31a Issue #1894
Add SYNC arg to FLUSHALL and FLUSHDB, and ASYNC/SYNC arg to SCRIPT FLUSH
2022-04-07 21:54:14 +03:00
Pavlo Yatsukhnenko 831d6118c4 Remove weird macroses 2022-04-04 21:04:00 +03:00
Pavlo Yatsukhnenko 01f3342c72 Issue #1894
Add XAUTOCLAIM command
2022-03-30 21:01:02 +03:00
Pavlo Yatsukhnenko f9436e255b [WIP] Issue #1894
Add NOMKSTREAM option to XADD command.
2022-03-21 19:41:08 +02:00
Michael Grunder a64a0c3785 Fix fallthrough warnings and refactor adding a score (#2049)
* Suppress implicit fallthrough warnings by using an attribute if we
  have it and a do { } while(0) if we don't.

* Move duplicated logic for appending a ZSET score to one utility
  function.
2022-01-20 10:54:57 -08: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 e9619bb319 Use ZEND_HASH_FOREACH_STR_KEY_VAL when numeric index isn't used 2021-11-17 23:09:28 +02:00
Pavlo Yatsukhnenko 82dd8e56d3 Issue #2030 2021-11-12 18:08:16 +02:00
Pavlo Yatsukhnenko cb41edff5a Use ZEND_HASH_FOREACH_STR_KEY_VAL when numeric index isn't used 2021-09-25 19:30:08 +03:00
Remi Collet 7e621b99da use zend_parse_parameters_none 2021-08-26 09:53:07 +03:00
Nathaniel Braun 18706d9271 Add support for exponential backoff on retry 2021-07-20 09:21:13 +00:00
michael-grunder 4cb4cd0ee2 Separate compression and create utility methods
This commit splits compression and serialization into two distinct parts
and adds some utility functions so the user can compress/uncompress
or pack/unpack data explicily.

See #1939
2021-06-22 10:16:23 -07:00
Pavlo Yatsukhnenko 568fc3a824 [WIP] Issue #1894
Add GT and LT options to ZADD.
2021-05-14 15:24:13 +03:00
Pavlo Yatsukhnenko 28de62202e [WIP] Issue #1894
Add IDLE argument to XPENDING command
2021-04-15 18:49:46 +03:00
Pavlo Yatsukhnenko 6aa9c0899c Add PHPREDIS_CTX_PTR magic value 2021-04-14 12:55:38 +03:00
Pavlo Yatsukhnenko b0b9dd78ef [WIP] Issue #1894
Add GET option to SET command
2021-04-10 21:26:29 +03:00
Pavlo Yatsukhnenko d5cf52cb8a [WIP] Issue #1894
Add Redis::zinter and Redis::zunion commands
2021-03-20 23:29:08 +02:00
Pavlo Yatsukhnenko 5d50fef961 [WIP] Issue #1894
Add Redis::zdiff and Redis::zdiffstore commands
2021-03-06 20:15:36 +02:00
Pavlo Yatsukhnenko 037dbbf93d [WIP] Issue #1894
Add Redis::copy command
2021-02-27 23:17:20 +02:00
Pavlo Yatsukhnenko f3ad8e20a3 [WIP] Issue #1894
Add Redis::lMove command.
2021-01-29 19:17:51 +02:00
Pavlo Yatsukhnenko 3a09f69b09 Issue #1873
ZADD scores must be numeric or '-inf', '+inf'
2020-11-16 09:28:34 +02:00
Pavlo Yatsukhnenko 9f2972b54e Use zend_string_equals_literal_ci instread of macros 2020-11-04 18:33:29 +02:00
Michael Grunder 514bc37102 Verify SET options are strings before testing them as strings. (#1859)
Addresses #1835
2020-10-13 13:05:20 -07:00
Michael Grunder 950e8de807 Issue.1847 cluster segfault (#1850)
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>
2020-09-28 11:07:46 -07:00
Michael Grunder 3645807188 Relax requirements on set's expire argument (#1830)
Relax requirements on set's expire argument

See: #1783
2020-08-30 13:51:12 -07:00
Pavlo Yatsukhnenko a7662da792 Don't use zend_fcall_info.no_separation 2020-07-09 13:01:34 +03:00
Michael Grunder a311cc4ec3 Support for Redis 6 ACLs (#1791)
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).
2020-06-24 17:00:01 -07:00
Michael Grunder 04def9fbe2 Rebased LZ4 PR (#1781)
LZ4 compression by @iliaal
2020-06-07 14:09:30 -07:00
Michael Grunder a0c53e0b30 Issue.1762 xinfo full (#1771)
Add support for `XINFO STREAM FULL [COUNT]`
2020-06-07 13:48:06 -07:00
Michael Grunder 5bf881244d Use ZEND_LONG_FMT and avoid typecast in hMset (#1770)
See #1764
2020-05-31 22:36:36 -07:00
Michael Grunder f9c7bb5788 Adds Redis 6.0 KEEPTTL option for SET (#1766)
Added support for KEEPTTL option of SET command, which added in Redis 6

See: #1761

Co-authored-by: victor <viktork@sekindo.com>
2020-05-23 14:25:41 -07:00
Pavlo Yatsukhnenko e80600e244 Issue #548 (#1649)
Adds `Redis::SCAN_PREFIX` and `Redis::SCAN_NOPREFIX` as options to SCAN.

See #548
2020-05-18 18:11:40 -07:00
Pavlo Yatsukhnenko c94e28f1eb Add RedisSentinel class and tests 2020-02-06 14:14:46 -08:00
michael-grunder a107c9fc08 Fix a couple of memory leaks in Redis/RedisCluster
Addresses #1701
2020-01-19 09:35:24 -08:00
Tyson Andre 0ef488fca7 Remove "PHP Version 5" section
package.xml has a minimum version of 7.0
PHP 8.0 will probably be out in around a year.
2020-01-13 18:41:03 -05:00
Tyson Andre f52bd8a853 Fix typos detected by codespell 2020-01-06 09:08:36 -05:00
Remi Collet b4eb158a00 ulong => zend_ulong for 7.4 2019-07-18 10:37:02 +02:00
Remi Collet 943802272a cleanup TSRMLS_* usage 2019-07-09 15:26:44 +02:00
Remi Collet 2abc61da31 Add support for Zstd compression 2019-07-09 10:00:40 +02:00
michael-grunder 0c17bd27a0 Make the XREADGROUP optional COUNT and BLOCK arguments nullable.
Change the way we accept COUNT and BLOCK such that a user can pass NULL
to mean "no value".  This is technically a breaking change, since
previously the value `-1` was used for "no value".

Fixes #1560
2019-06-04 13:37:52 -07:00
michael-grunder 6e49417068 Allow PING to take an optional argument.
Addresses #1563
2019-06-03 07:53:21 -07:00
Michael Grunder 19f3efcfe6 Issue.1555 zrange withscores arg (#1565)
Allows ZRANGE to be called either with `true` or `['withscores' => true]` so it's consistent with `ZRANGEBYSCORE` but also backward compatible.

Fixes #1555
2019-06-02 17:44:26 -07:00
michael-grunder 5cb30fb2a6 Adds OPT_REPLY_LITERAL for rawCommand and EVAL
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
2019-05-13 09:38:18 -07:00
Pavlo Yatsukhnenko 98bd2886c3 JSON serializer 2019-05-12 15:30:47 +03:00
michael-grunder 591585c4bc Type correctness for zval_get_long return value 2019-04-04 13:06:11 -07:00
Joyce Babu 4c7643ee11 Fix TypeError when using built-in constants in setOption
In strict_type mode `Redis::setOption` requires the second argument
to be of type `string`. This throws a TypeError for some options,
even when using built-in constants

The type of `value` argument of setOption has been changed to
mixed to prevent the error.
2019-04-04 13:00:27 -07:00