forked from phpredis/phpredis
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] develop from phpredis:develop #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pull
wants to merge
250
commits into
wudi:develop
Choose a base branch
from
phpredis:develop
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Update zCount argument type in redis.stub.php zCount's min/max can also be an integer. * fix arginfo
* Add what value failed to pass our callback assertion so we can see what we actually got from the server. * WAITAOF requires Redis >= 7.2.0 so don't run it if the server is older than that.
We actually had two different bits of logic to handle EXPIRY values in the `SET` command. One for the legacy `SET` -> `SETEX` mapping and another for the newer `SET foo bar EX <expiry>`. Additionally the error message could be confusing. Passing 3.1415 for an `EX` expiry would fail as we didn't allow floats. This commit consolidates expiry parsing to our existing helper function as well as improves the `php_error_docref` warning in the event that the user passes invalid data. The warning will now tell the user the type they tried to pass as an EXPIRY to make it easier to track down what's going wrong. Fixes #2448
* We need both PHP_ADD_LIBRARY_WITH_PATH and PHP_ADD_INCLUDE Fixes #2452 * Add an initial test block for ./configure correctness.
Technically Redis may return any unsigned 64 bit integer as a scan cursor. This presents a problem for PHP in that PHP's integers are signed. Because of that if a scan cursor is > 2^63 it will overflow and fail to work properly. This commit updates our SCAN family of commands to deliver cursors in their string form. ```php public function scan(null|int|string $iterator, ...); ``` On initial entry into our SCAN family we convert either a NULL or empty string cursor to zero, and send the initial scan command. As Redis replies with cursors we either represent them as a long (if they are <= ZEND_ULONG_MAX) and as a string if greater. This should mean the fix is minimally breaking as the following code will still work: ```php $it = NULL; do { print_r($redis->scan($it)); } while ($it !== 0); ``` The `$it !== 0` still works because the zero cursor will be represented as an integer. Only absurdly large (> 2^63) values are represented as a string. Fixes #2454
PHP 8.4 has some breaking changes with respect to where PHP's random methods and helpers are. This commit fixes those issues while staying backward compatible. Fixes #2463
Replace `SOCKET_WRITE_COMMAND` with `redis_sock_write` because it can't be used with pre-defined commands (it frees memory in case of failed writing operation). After replacement `SOCKET_WRITE_COMMAND` becomes redundant so remove it.
Fix segfault and remove redundant macros
This commit fixes our unit tests so they also pass against the KeyDB server. We didn't ned to change all that much. Most of it was just adding a version/keydb check. The only change to PhpRedis itself was to relax the reply requirements for XAUTOCLAIM. Redis 7.0.0 added a third "these elements were recently removed" reply which KeyDB does not have. Fixes #2466
See: #2466
Mention support for KeyDB in README.md. Remove credit for Owlient from the first paragraph. Owlient was acquired by Ubisoft in 2011, so presumably no longer benefit from such prominent credit.
Fix Arginfo / zpp mismatch for DUMP command
When a node timeout occurs, then phpredis will try to connect to another node, whose answer probably will be MOVED redirect. After this we need more time to accomplish the redirection, otherwise we get "Timed out attempting to find data in the correct node" error message. Fixes #795 #888 #1142 #1385 #1633 #1707 #1811 #2407
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
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.
In cluster mode the destination and source keys must hash to the same slot.
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
This lets users configure `maxRetries` with `RedisSentinel` Fixes #2700
* Fix typos and basic grammar errors in README.md Co-authored-by: michael-grunder <[email protected]> * Improve grammar, clarity, and consistency in README.md Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Michael Grunder <[email protected]>
- using pie - Fedora and EL have v6
* fix markdown headlines * fix headlines * remove extra diviver * remove nbsp
* 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.
Co-authored-by: michael-grunder <[email protected]>
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.
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.
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 <[email protected]>
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )