class TagKeyBuilder

Builds Redis-internal tag storage key names.

The key formats here are Redis implementation details that were previously methods on the TagMode enum. Moved out so the enum stays purely semantic.

Methods

__construct(TagMode $mode, string $prefix)

No description

static string
tagSegmentFor(TagMode $mode)

Mode-only tag segment, for callers that don't have a prefix to hand (e.g. console tools that concatenate a cachePrefix externally).

string
tagSegment()

Tag segment prefix: "_any:tag:" or "_all:tag:".

string
tagId(string $tagName)

Tag identifier (without cache prefix): "_any:tag:{tagName}:entries".

string
tagKey(string $tagName)

Full tag key with cache prefix: "{prefix}_any:tag:{tagName}:entries".

string
reverseIndexKey(string $cacheKey)

Full reverse index key: "{prefix}{cacheKey}:_any:tags".

string
registryKey()

Full registry key: "{prefix}_any:tag:registry".

Details

at line 18
__construct(TagMode $mode, string $prefix)

No description

Parameters

TagMode $mode
string $prefix

at line 28
static string tagSegmentFor(TagMode $mode)

Mode-only tag segment, for callers that don't have a prefix to hand (e.g. console tools that concatenate a cachePrefix externally).

Parameters

TagMode $mode

Return Value

string

at line 36
string tagSegment()

Tag segment prefix: "_any:tag:" or "_all:tag:".

Return Value

string

at line 44
string tagId(string $tagName)

Tag identifier (without cache prefix): "_any:tag:{tagName}:entries".

Parameters

string $tagName

Return Value

string

at line 52
string tagKey(string $tagName)

Full tag key with cache prefix: "{prefix}_any:tag:{tagName}:entries".

Parameters

string $tagName

Return Value

string

at line 62
string reverseIndexKey(string $cacheKey)

Full reverse index key: "{prefix}{cacheKey}:_any:tags".

Any mode uses this to track which tags a cache key belongs to.

Parameters

string $cacheKey

Return Value

string

at line 72
string registryKey()

Full registry key: "{prefix}_any:tag:registry".

Any mode uses this as a sorted set of all active tags.

Return Value

string