3294 Commits

Author SHA1 Message Date
michael-grunder
2f2d81149d Update CHANGELOG and package.xml 2025-10-06 16:24:55 -07:00
Pavlo Yatsukhnenko
7d3b2e4d6d Add hGetWithMeta method 2025-10-06 16:22:59 -07:00
michael-grunder
9dfc377902 Update CHANGELOG.md 2025-10-06 12:52:36 -07:00
michael-grunder
547475295a Introduce "must use attribute"
Conditionally add `[[nodiscard]]` (c23) or
`__attribute__((warn_unused_result))` when the compiler supports it.

This commit initially just adds iit to `cluster_map_keyspace` but we can
go throughour API adding it where appropriate.
2025-10-06 12:52:36 -07:00
Rasmus Lerdorf
5ebb853e1a Fix segfault during Redis Cluster failover
When a Redis Cluster failover occurs, the client detects that the
redirected node was a replica of the old master and calls
cluster_map_keyspace() to remap the cluster topology.

If cluster_map_keyspace() fails (e.g., due to network issues during
the remap), it frees all node objects via zend_hash_clean(c->nodes)
and zeros the master array via memset(c->master, 0, ...).

The bug was that the return value of cluster_map_keyspace() was being
ignored in the failover detection path. This caused the code to
continue with NULL socket pointers, leading to segfaults when
dereferencing c->cmd_sock later.

This fix:
1. Checks the return value of cluster_map_keyspace() in failover
   detection and returns FAILURE if it fails
2. Adds defense-in-depth NULL checks after MOVED and ASK redirections
   to prevent segfaults if slots become NULL for any reason

Fixes production crashes observed during Redis Cluster failovers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-05 21:13:23 -07:00
Remi Collet
f5db01b781 fix testXGrous expectation for change in redis 8.2.2 2025-10-03 06:03:36 -07:00
Remi Collet
4517d5f910 bump version 2025-10-03 06:03:36 -07:00
michael-grunder
6ca84b668c Update package.xml for the 6.3.0RC1 release. 2025-10-02 21:06:59 -07:00
michael-grunder
f7e6981084 Normalize package.xml with an automatic formatter
We've basically maintained `package.xml` by hand all these years which
makes it a pretty big pain to do a new release. This commit uses a small
utility program to normalize the spacing with PHP's simplexml extension.
2025-10-02 21:06:59 -07:00
michael-grunder
bddb0305f4 Minor changelog.md fix 2025-10-02 21:06:59 -07:00
michael-grunder
0fff135257 Add VRANGE commit to CHANGELOG.md 2025-10-02 21:06:59 -07:00
michael-grunder
d01614b7a4 Add a release blurb. 2025-10-02 21:06:59 -07:00
michael-grunder
3822a11f45 Consolidate several similar commits + recategorize
We can consoildate a bunch of commits into one changelong line item
(e.g. all the vectorset commits).

Additionally recategorize several other line items to best fit our
categories.
2025-10-02 21:06:59 -07:00
copilot-swe-agent[bot]
2e5e47da75 Add 6.3.0RC1 section to CHANGELOG.md
Co-authored-by: michael-grunder <468149+michael-grunder@users.noreply.github.com>
2025-10-02 21:06:59 -07:00
michael-grunder
6ce3bd533a Implement VRANGE command and add a test 2025-10-02 11:12:39 -07:00
Till Krüss
7a69d7301c Update sponsorship (#2719)
* Update contact information in README.md
* align sponsorship logos

Added PayPal as an additional support option for the project.

* add spacing

Added line breaks for improved formatting.

* fix list indentation

* mention relay

Added a new section on sponsorship and support for the project.

* Update Relay support description in README

Clarified the description of Relay's support for PhpRedis.
2025-10-02 09:44:42 -07:00
Till Krüss
2066cfad26 document PECL configure options 2025-09-26 10:10:17 -07:00
Till Krüss
1d662f56aa Fix markdown headlines (#2718)
* fix markdown headlines
* fix headlines
* remove extra diviver
* remove nbsp
2025-09-25 13:16:50 -07:00
Till Krüss
0ac014764d Improve wording in README about project support 2025-09-23 16:56:48 -07:00
Remi Collet
c0076036d9 Improve install instructions
- using pie
- Fedora and EL have v6
2025-09-18 08:29:19 -07:00
Copilot
09cd4c54b9 Clean up README.md: fix typos, spelling, and grammar errors (#2713)
* Fix typos and basic grammar errors in README.md

Co-authored-by: michael-grunder <468149+michael-grunder@users.noreply.github.com>

* Improve grammar, clarity, and consistency in README.md

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Michael Grunder <michael.grunder@gmail.com>
2025-09-13 10:59:30 -07:00
michael-grunder
e9e9e49509 Add maxRetries to redis_sock_configure.
This lets users configure `maxRetries` with `RedisSentinel`

Fixes #2700
2025-09-12 09:32:02 -07:00
Josh
f9f609e1eb Refine parameter descriptions and examples in README 2025-09-12 09:31:37 -07:00
michael-grunder
1d07c3a07e Add a .github/copilot-instructions.md file
Additionally remove `.github` from our root-level `.gitignore` file. I
assume it was erroneously added some time ago since we have files in
this repo.

Fixes #2705
2025-09-10 16:54:46 -07:00
michael-grunder
f24814a423 Fix geosearchstore bypolygon test
In cluster mode the destination and source keys must hash to the same
slot.
2025-09-10 11:56:49 -07:00
michael-grunder
b3da0f3bcf Remove a "bad argument" assertion for testWait
It seems like Redis changed what it will do when you send a negative
number of events. Previously this would just return an error but it
seems to return `1` now.

For this reason just remove that assertion so we don't have to use
different logic depending on the version of the server.
2025-09-10 11:33:35 -07:00
michael-grunder
22a2914b09 Add a regression test 2025-09-09 16:30:43 -07:00
michael-grunder
35df8ad7c2 Attempt to fix an overflow bug in ZADD on Windows
Theory: In 64 bit windows `long` is 32 bits wide meaning that using a
long to append `ZADD` scores can truncate.

Possible fix for #2697
2025-09-09 16:30:43 -07:00
Christian Flothmann
25e6d5fcc2 fix typo (s/sees/seeds/) 2025-09-07 14:34:05 -07:00
Michael Grunder
d0b0c5cfdd Fix typo
Co-authored-by: Pavlo Yatsukhnenko <yatsukhnenko@users.noreply.github.com>
2025-09-01 09:41:12 -07:00
michael-grunder
92137ffd3f We actually do return bool in sismember so do the same here 2025-09-01 09:41:12 -07:00
michael-grunder
38115decb9 Fix VISMEMBER unit test 2025-09-01 09:41:12 -07:00
michael-grunder
b8de91c9e0 Fix errors and a warning
* PHP < 8.0 took a `char*` as `php_json_decode` input, whereas newer
  versions take a const char * so ifdef around this.

* Fix compilation errors due to `false` not being defined. So as to make
  a minimal change we can just use 0 and 1
2025-09-01 09:41:12 -07:00
michael-grunder
92dd256f98 Implement VISMEMBER command. 2025-09-01 09:41:12 -07:00
michael-grunder
c4b2ea6ca5 Fix VEMB reply handling in RedisCluster 2025-09-01 09:41:12 -07:00
michael-grunder
0b4b4ed2c3 Add a test for VGETATTR 2025-09-01 09:41:12 -07:00
michael-grunder
d80b725824 Implement VGETATTR command 2025-09-01 09:41:12 -07:00
michael-grunder
7f9b1f416e Implement VLINKS command 2025-09-01 09:41:12 -07:00
michael-grunder
ea11d62aec Test for VSETATTR 2025-09-01 09:41:12 -07:00
michael-grunder
92716ed0c5 Implement VSETATTR command 2025-09-01 09:41:12 -07:00
michael-grunder
65927b53b1 We can use redis_kv_cmd instead of a specific vrem command. 2025-09-01 09:41:12 -07:00
michael-grunder
5fe188416d Add a test for VRANDMEMBER 2025-09-01 09:41:12 -07:00
michael-grunder
bbae745a93 Add a test for VREM
See #2543
2025-09-01 09:41:12 -07:00
michael-grunder
dc91631b3f Implement VREM command
See #2543
2025-09-01 09:41:12 -07:00
michael-grunder
1deca62841 Implement VRANDMEMBER
`VRANDMEMBER` has the exact same semantics of `SRANDMEMBER` so make
`SRANDMEMBER` a keyword based command and use it for `VRANDMEMBER`.

See #2543
2025-09-01 09:41:12 -07:00
michael-grunder
96378b70fd Implement VEMB and slightly rework VINFO
Unfortunately `VEMB` has a unique `RESP2` reply as far as I can tell,
where it sends the embedding mode (int8, bin, fp32) as a simple string.

This would cause any of PhpRedis' generic reply handlers to turn that
into `true` which isn't useful. For that reason we need a custom reply
handler.

Additionally slightly rework `VINFO` to short circuit and return failure
if we read anything other than a bulk string or an integer reply type.
Otherwise we may get out of sync on the socket.

See #2543
2025-09-01 09:41:12 -07:00
michael-grunder
8f8a49bec2 Tests for VCARD, VDIM, and VINFO. 2025-09-01 09:41:12 -07:00
michael-grunder
0fda9f293b Implement VCARD, VDIM, and VINFO
All of these commands have the same form `<cmd> key`. `VINFO` is a bit
of an outlier however that uses simple strings as opposed to bulk
strings for the key names, meaning we had to create a custom handler.

See #2543
2025-09-01 09:41:12 -07:00
michael-grunder
0ed0fc0562 Add Redis::REDIS_VECTORSET type.
Redis >= 8.0 has a new type `vectorset` that we should support like all
the other types.
2025-08-28 09:34:07 -07:00
michael-grunder
659dc763e0 Refactor redis_replicaof_cmd
It was the last place we were using `REDIS_SPPRINTF` in
`redis_commands.c`.
2025-08-27 16:37:08 -07:00