Repository navigation
feat: real flush() via ephpm_kv_flush_all - #1
Merged
Merged
Conversation
Wire a working flush through the KV-ops trio into EphpmStore so Cache::flush() and "php artisan cache:clear" actually drop entries. - KvOpsInterface/SapiKvOps/InMemoryKvOps gain flush(): SapiKvOps calls ephpm_kv_flush_all() behind a function_exists guard (no-op false on pre-v0.1.2 runtimes); InMemoryKvOps clears its arrays. - EphpmStore::flush() now delegates to ops->flush() instead of always returning false. - Register the cache driver in boot() rather than register(): the cache manager is not yet bound during this provider's register() phase, so Cache::extend() there threw "Target class [cache] does not exist" and broke the whole test suite (and CI). - Fix two pre-existing test bugs surfaced once the suite runs: a serialized-bytes assertion and a call to the non-existent CacheManager::getDriver().
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 a real
flush()now that ePHPm v0.1.2 ships theephpm_kv_flush_all(): boolSAPI function.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.EphpmStore::flush()previously hard-returnedfalse(no key enumeration was possible). It now delegates to$this->ops->flush(), soCache::flush()andphp artisan cache:clearactually clear the store. It still returnsfalseon pre-v0.1.2 runtimes via the guard.false(recommended fallback: bump the cache prefix and let TTL age entries out).Test
test_flush_clears_all_entries(usesInMemoryKvOps): puts two keys, flushes, asserts both gone andflush()returnedtrue.OK (28 tests, 75 assertions)under PHP 8.3.composer validate --strictpasses.Incidental fixes (required to make the suite run)
register(), calling theCachefacade before the framework's cache manager was bound — this threwTarget class [cache] does not existand broke the entire suite (CI onmainis currently red for this reason). Moved theCache::extend()call toboot(), the standard spot for driver extensions.CacheManager::getDriver().Do not merge yet.