Repository navigation
feat: use ePHPm v0.13 KV functions (hashes, MGET/MSET, GETDEL/GETEX, SCAN, SET IFEQ) - #4
Merged
Merged
Conversation
….13 KV functions Each command is feature-detected per ephpm_kv_* function; on an older ePHPm it raises CommandNotSupportedException exactly as before. TYPE reports 'hash' via ephpm_kv_type when available. Backends opt in through the new ExtendedKvOpsInterface, so custom KvOpsInterface implementations keep working unchanged.
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.
Wires the Redis commands that ePHPm v0.13.0's new
ephpm_kv_*functions can serve.What changes
CommandNotSupportedExceptionand are never ignored, because they would need a non-atomic read-then-write. HPEXPIRE and the *AT variants stay unsupported.[cursor-as-string, keys], so Predis'Keyspaceiterator works. The TYPE filter is unsupported. The README notes that in a cluster SCAN only sees this node's keyspace.SET … IFEQmaps toephpm_kv_set_if_eq.KEEPTTLis accepted together with IFEQ only.hashthroughephpm_kv_typewhen that function exists.Compatibility
function_exists. On an older ePHPm the command raisesCommandNotSupportedExceptionas it does today, and TYPE falls back to the exists-based answer.SET … IFEQused to throwInvalidArgumentException("unknown SET modifier"). It now throwsCommandNotSupportedException('SET IFEQ'), the same exception the other unsupported SET modifiers already throw.ExtendedKvOpsInterface, so existing customKvOpsInterfaceimplementations still compile.InMemoryKvOpsimplements the new commands.new InMemoryKvOps([])behaves like a runtime from before v0.13.Tests
KvConnectionExtendedTestruns every mapping through a real Predis client, so Predis does its own response parsing.EXTENDED_COMMANDSentry has a fallback case.SapiKvOpsTestadds cases forsupports()and for passing calls through to the stubs.