Documentation

NamespacedVersionedKeys

Shared namespace/version key-building for adapters that scope clear()/destroy() to a namespace via generational versioning (Apc, Memcached, Redis) rather than wiping the whole shared backend

Using classes must have a protected string $namespace property and implement fetchVersion() to read the raw version value back from their own backend.

Tags
category

Pop

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
5.0.0

Table of Contents

Methods

fetchVersion()  : mixed
Fetch the raw version value from the backend, or false if it isn't set
key()  : string
Build the versioned, namespaced storage key for an item id
resolveVersion()  : int
Resolve the current version for this namespace, defaulting to 1
versionKey()  : string
Get the storage key for this namespace's version counter

Methods

fetchVersion()

Fetch the raw version value from the backend, or false if it isn't set

protected abstract fetchVersion(string $key) : mixed
Parameters
$key : string

key()

Build the versioned, namespaced storage key for an item id

protected key(string $id) : string
Parameters
$id : string
Return values
string

resolveVersion()

Resolve the current version for this namespace, defaulting to 1

protected resolveVersion() : int
Return values
int

versionKey()

Get the storage key for this namespace's version counter

protected versionKey() : string
Return values
string

        
On this page

Search results