Alpha ZealPHP is early-stage and under active development. APIs may change between minor versions until v1.0. Feedback and bug reports welcome on GitHub.
API Index — Namespaces, Packages, Reports, Indices

Store

Table of Contents

Interfaces

RedisDriver
Behavioural contract for a Redis/Valkey client lib (phpredis or predis).
StoreBackend
Behavioural contract every Store backend implements.

Classes

CircuitBreakerBackend
3-state circuit breaker decorator for StoreBackend. Opt-in only: applications that want "Redis down → degrade to Table cache" wrap their RedisBackend in this decorator at boot. Default behaviour is unchanged — apps that don't wrap see the same throw-on-Redis-failure semantics they had before.
MemcachedBackend
Memcached-backed StoreBackend.
PhpredisDriver
phpredis-backed driver. Only instantiable when the redis PHP extension is loaded; the adapter falls back to predis otherwise. Tests skip the phpredis-specific path when the ext isn't present (covered by CI matrix).
PredisDriver
predis-backed driver. Pure PHP — works without ext-redis. Slower than phpredis but parity-tested against the same RedisClientTest cases.
PubSubStopException
Sentinel thrown from inside a SUBSCRIBE consumer to signal clean shutdown.
RedisBackend
Redis/Valkey-backed StoreBackend.
RedisClient
Thin adapter over phpredis (preferred when ext-redis is loaded) or predis (pure-PHP fallback). The ONE place the client lib is referenced by name in ZealPHP — every other class talks to this adapter.
RedisConnectionPool
Per-worker pool of RedisClient connections.
RedisPubSub
Per-worker pub/sub runner.
RedisStreams
Per-worker Redis Streams consumer runner.
Stats
Per-worker counter struct for Store/Counter/Pool/Subscriber observability.
StoreException
Thrown by every public method in the ZealPHP\Store namespace.
TableBackend
Default StoreBackend — wraps OpenSwoole\Table.
TieredBackend
Three-tier-ready hybrid backend — TableBackend as L1 (in-process, ns latency, bounded staleness) + RedisBackend as L2 (cross-node, source of truth, ~µs to ~ms).
TypeCodec
Backend-neutral row (de)serialization.

Enums

DriverPreference
Type-safe enum for RedisClient's driver selection. Accepted by Store::defaultBackend() via the 'prefer' opt and by RedisClient::__construct()'s opts array.
StoreBackendKind
Type-safe enum for the Store backend kind.
On this page