Skip to content

fix: guard flush() for pre-v0.1.2 ePHPm runtimes#1

Merged
luthermonson merged 1 commit into
mainfrom
fix/flush-guard
Jun 23, 2026
Merged

fix: guard flush() for pre-v0.1.2 ePHPm runtimes#1
luthermonson merged 1 commit into
mainfrom
fix/flush-guard

Conversation

@luthermonson

Copy link
Copy Markdown
Contributor

SapiKvOps::flush() called ephpm_kv_flush_all() unconditionally, but that SAPI fn only exists in ePHPm v0.1.2+. On an older runtime wp_cache_flush() would fatal (Call to undefined function) instead of no-op.

Guard with function_exists (matching ephpm/predis-connection): returns false on older runtimes, entries age out via TTL. This decouples the drop-in from the ePHPm release so it can ship now and flush activates automatically once v0.1.2 deploys.

Tests: 33/33 green (unit tests use InMemoryKvOps, unaffected).

SapiKvOps::flush() called ephpm_kv_flush_all() unconditionally. That SAPI
function only exists in ePHPm v0.1.2+, so on an older runtime wp_cache_flush()
would fatal with 'Call to undefined function' rather than no-op. Guard with
function_exists (matching ephpm/predis-connection): flush returns false on
older runtimes and entries age out via TTL. Decouples the drop-in from the
ePHPm release — it can ship now and flush lights up automatically once
v0.1.2 is deployed.
@luthermonson luthermonson merged commit 2e630d5 into main Jun 23, 2026
3 checks passed
@luthermonson luthermonson deleted the fix/flush-guard branch June 23, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant