Repository navigation
fix(starter): Redis drop-in fatal when REDIS_PORT is unset - #17
Merged
Merged
Conversation
Define WP_REDIS_HOST/PORT only when set (port as int), so the drop-in's 127.0.0.1:6379 defaults apply. Enable selective flush by default for shared Redis dbs; WP_REDIS_SELECTIVE_FLUSH=false opts out. Claude-Session: https://claude.ai/code/session_01N2CKAdb8iZMn5mbymAy6Bc
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.
Problem
config/application.phpdefinedWP_REDIS_HOST/WP_REDIS_PORTasenv(...) ?? ''. When the environment has noREDIS_PORT(the default on SpinupWP), the drop-in gets''instead of its127.0.0.1:6379defaults, and phpredis fatals:Hit on apollobc.sk when enabling the Redis drop-in. Projects without the drop-in never notice, but 14 local projects carry the same lines.
Separately, many sites share one Redis db (
db0) on a server. WithoutWP_REDIS_SELECTIVE_FLUSH, the SpinupWP drop-in'swp_cache_flush()runsFLUSHDBand wipes every site's cache.Change
WP_REDIS_HOST/WP_REDIS_PORTonly when set; cast the port to int.WP_REDIS_SELECTIVE_FLUSHdefaults totrue; settingWP_REDIS_SELECTIVE_FLUSH=falseopts out.packages/webentor-starterand itstest-sitemirror.Verification
php -lon both files.env(): unset/empty host+port leave the constants undefined;REDIS_PORT=6380gives int6380; selective flush istrueby default andfalsewith the opt-out.WP_REDIS_SELECTIVE_FLUSH=true.No starter release in this PR; existing projects need the change applied by hand or via the next starter release.
https://claude.ai/code/session_01N2CKAdb8iZMn5mbymAy6Bc