Commit Graph

3334 Commits

Author SHA1 Message Date
michael-grunder d5b1576e27 docs: Syntax highlight parameter arg names 2025-11-10 21:17:57 -08:00
michael-grunder 5fe0862109 docs: Syntax highlight string literals in green 2025-11-09 18:17:42 -08:00
michael-grunder 38e56d5738 docs: Highlight the individual doctum params 2025-11-09 18:17:42 -08:00
michael-grunder 9edc242579 docs: Apply syntax highlighting to the index section. 2025-11-09 18:17:42 -08:00
michael-grunder d45c4d294c docs: We want our docs based on develop not main 2025-11-09 18:17:42 -08:00
Michael Grunder ae69e47a08 Additional doctum syntax highlighting. (#2763)
* docs: Syntax highlight ```php ... ``` code blocks

* docs: More syntax highlighting

* docs: Allow `highlight.js` to syntax highlight `Redis`.

* docs: Rebuild doctum static files
2025-11-09 16:24:16 -08:00
michael-grunder 9b17434e3d Update .gitignore 2025-11-08 21:26:37 -08:00
michael-grunder 4cf670fed3 docs: Add syntax highlighting to method signatures 2025-11-08 21:26:37 -08:00
michael-grunder e460a8595a docs: Add doctum theme and syntax highlighting 2025-11-08 21:26:37 -08:00
michael-grunder 1297c48c14 docs: Initial syntax highlighing integration 2025-11-08 21:26:37 -08:00
michael-grunder b30fe1d1c7 Add vendor to .gitignore 2025-11-08 14:31:14 -08:00
michael-grunder 9e9ccbd441 Update doctum docs 2025-11-08 14:13:56 -08:00
michael-grunder abce1655b9 Add examples to methods missing them. 2025-11-08 14:13:56 -08:00
michael-grunder ecdc290bba Update doctum docs 2025-11-07 11:49:57 -08:00
michael-grunder 10c0bf0fcf Update doctum-config.php 2025-11-07 11:49:57 -08:00
michael-grunder d6437f5e95 Rework documentation for our local helper methods
Things like `_pack`, `_unpack`, `_serialize`, etc.
2025-11-07 10:43:05 -08:00
michael-grunder 107cc7aacb Make sure _digest throws an exception in PHP < 8.1 2025-11-06 11:00:16 -08:00
michael-grunder 00c62de277 Implement DELEX command 2025-11-06 09:48:09 -08:00
michael-grunder e2dd13ce7b Implement DIGEST and _digest helper (for php >= 8.1)
Redis implemented new CAS semantics which work both with values and the
XXH3 digest of those values.

This commit implements the Redis command itself and a helper which
computes the XXH3 digest locally. Note that we can only be sure to have
the `XXH3` hashing algorithm in PHP >= 8.1 so the `_digest` helper is
limited to PHP 8.1 or newer.
2025-11-06 09:48:09 -08:00
michael-grunder 025b0e9772 Prevent UB in session weighted selection
```c
int pos, i;
memcpy(&pos, key, sizeof(pos));
pos %= pool->totalWeight;
```

As unlikely as it is, this may cause UB if user's are generating their
own session IDs shorter than three bytes. This commit checks the session
id length and only copies in the bytes that we have.

Technically this could change behavior for session ID's of length 2 or
less, but this seems acceptable because currently such an ID would end
up selecing a server at random, depending on whatever bytes were past
the end of the `zend_string`.

In a future release we will fix this logic to use all of the entropy of
the session ID as well as ensure `pool->totalWeight` is > 0.
2025-11-05 13:49:20 -08:00
michael-grunder bf2047e067 Inform the user if we couldn't extract any session servers.
Add a specific warning when we can't parse any servers from
`php.session_save_path`.

PHP will then display the save path, but this will let users know there
was a problem parsing the path.

Fixes #1390

Signed-off-by: michael-grunder <michael.grunder@gmail.com>
2025-10-31 11:11:27 -07:00
michael-grunder 453c4788d6 Improve error message when picking session compression
The warning when a user picks an unsupported session compression
algorithm was pretty confusing.

The new message tells the user if the selection was invalid or only
invalid because the redis.so wasn't built with support.

Fixes #2570
2025-10-31 11:10:45 -07:00
michael-grunder 6e214c1698 Cloning our objects should not segfault
In a future release we can actually implement cloning logic along with
lazy reconnection but for now, just throw a fatal error.

Fixes #1760
2025-10-31 11:09:45 -07:00
michael-grunder 8894de5a0b Update stub hashes 2025-10-31 08:32:04 -07:00
Michael Telgmann b742bb8bdb fix: Change typehint to RedisArray 2025-10-31 07:54:44 -07:00
Michael Telgmann 9c9d0286f4 fix: Adjust PHPDoc comments to match parameter and return types 2025-10-31 07:54:44 -07:00
Michael Telgmann 8597d3d793 feat: Add method annotations for methods that are callable via magic __call method 2025-10-31 07:54:44 -07:00
Michael Telgmann 5afa8eb7e0 fix: Change nullable return types, so they can be better parsed 2025-10-31 07:54:44 -07:00
michael-grunder 4de4f727a4 WAIT and WAITAOF 2025-10-30 10:26:18 -07:00
michael-grunder 6b481b6f66 Document UNSUBSCRIBE and PUNSUBSCRIBE.
Fixes #1695
2025-10-30 09:29:02 -07:00
michael-grunder cd4cf653df Document WAIT and WAITAOF
Fixes #2541
2025-10-30 09:28:47 -07:00
michael-grunder c28430e5f6 Add specific TLS options documentation
Fixes #1999
2025-10-30 09:28:26 -07:00
Pavlo Yatsukhnenko 6c1fbf86ae Fix arginfo and stubs for RedisCluster 2025-10-30 09:24:20 -07:00
michael-grunder c8b79b1686 Add *.dep to .gitignore 2025-10-29 11:09:58 -07:00
michael-grunder c563c8cea3 Add missinig PECL/GitHub release urls 2025-10-19 14:47:02 -07:00
michael-grunder 4ff7d7e91e Merge release/6.3.0RC1 back into develop 2025-10-15 13:26:22 -07:00
michael-grunder ca25b6fd9f Prepare to tag 6.3.0RC1 6.3.0RC1 2025-10-14 16:06:23 -07:00
michael-grunder be4f14cccd Update CHANGELOG.md and package.xml 2025-10-09 18:37:40 -07:00
michael-grunder 675be9904d Update CHANGELOG.md 2025-10-09 12:11:20 -07:00
michael-grunder 0abe2c295e Fix HMGET where hash fields have an integer prefix
We were incorrectly ignoring errors when calling `is_numeric_string`,
meaning we would truncate hash fields that had integer prefixes.

```php
$redis->hmget('hash', ['123notaninteger']);
// Would actually execute:
// HMGET hash 123
```

Fixes #2731
2025-10-09 12:11:20 -07:00
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