feat: add flush() to KvOps trio (ephpm_kv_flush_all)#1
Open
luthermonson wants to merge 1 commit into
Open
Conversation
Backfills flush() into the KV-ops trio (KvOpsInterface, SapiKvOps, InMemoryKvOps) now that ePHPm v0.1.2 ships the ephpm_kv_flush_all(): bool SAPI function. SapiKvOps::flush() calls it behind a function_exists() guard so older runtimes return false instead of fataling. KvSessionHandler deliberately does NOT expose flush() through its public surface: a global flush wipes more than just session keys (no SCAN means we can't enumerate by prefix), and the recommended wholesale-invalidation pattern remains 'bump the prefix in config and let TTLs age the old sessions out'. The flush method is available at the ops layer for anyone driving SapiKvOps directly, and for parity with the other ephpm cache packages.
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.
What changed
Backfills
flush()into the KV-ops trio now that ePHPm v0.1.2 ships theephpm_kv_flush_all(): boolSAPI function — for parity with the other ephpm cache packages (cache-wordpress,predis-connection,cache-laravel,cache-symfony).KvOpsInterface,SapiKvOps,InMemoryKvOpsall gainflush().SapiKvOps::flush()callsephpm_kv_flush_all()behind afunction_existsguard so older runtimes returnfalseinstead of fataling;InMemoryKvOps::flush()clears its$values/$deadlinesarrays.What did NOT change
KvSessionHandlerdeliberately does not exposeflush():ephpm_kv_flush_all()is global — it wipes every key in the KV store, not just session keys.flush()is available at the ops layer for anyone drivingSapiKvOpsdirectly (and to keep the interface aligned across packages).Tests
InMemoryKvOpsTest::test_flush_clears_values_and_deadlines— flush wipes values AND deadlines (pttlreturns-2after).