Repository navigation
DOC-7345 Add a Predis set member expiration example to the sets page - #4662
Merged
Merged
Conversation
Adds a `member_expiration` step to the PHP `sets_tutorial` file (SADDEX
with `'ex', 900`, SADD, STTL) and adds PHP to the existing step's
`lang_filter` on sets.md. Node.js already had the step; this mirrors it.
Run-verified with the harness on redis:8.12-rc2 (server reports
8.11.241, the rc2 version string) against Predis v3.8.0. The step prints
1, 1, [900,900,-1].
Learned:
- The harness's portable PHP install only runs `composer require` when
vendor/predis is missing, so work/php can sit on an old Predis. It was
v3.5.1, which fails with "Command `SADDEX` is not a registered Redis
command". `composer update predis/predis` in build/example-test-harness/work/php
fixes it; work/ is gitignored.
- The example passes the SADDEX condition and TTL modifier as string
literals ('' and 'ex') instead of SADDEX::COND_NULL and TTL_EX, so the
step needs no `use` import outside the STEP block.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
Contributor
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at 6d52913 |
1 of 6 tasks
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
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.
Adds a
member_expirationstep to the PHPsets_tutorialexample (SADDEXwith a 900-second TTL,SADD,STTL) and adds PHP to that step'slang_filteron the sets page. Node.js already had this step.Run-verified with the example harness on
redis:8.12-rc2(the server reportsredis_version:8.11.241) against Predis v3.8.0. The new step prints1,1,[900,900,-1], and the wholeDtSetsTestpasses.Parked #4526 adds a Jedis step to the same block, so whichever merges second needs a one-line
lang_filtermerge. This PR is againstmainbecause Predis 3.8.0 is already released.🤖 Generated with Claude Code
Note
Low Risk
Documentation and local PHP example harness only; no runtime or security-sensitive code paths.
Overview
Extends the sets member expiration tutorial so PHP (Predis) appears alongside Node.js on the docs page by updating the
clients-examplelang_filtertoNode.js,PHP.Adds a matching
member_expirationstep toDtSetsTest.php:SADDEXwith a 900-second TTL for two members,SADDfor a third without expiry, andSTTLto show[900,900,-1], with PHPUnit assertions and cleanup.Reviewed by Cursor Bugbot for commit 6d52913. Bugbot is set up for automated code reviews on this repo. Configure here.