polysource / adapter-redis
Polysource — Redis adapter: 5 type-pure data sources (string, list, hash, set, sorted set) for read+write Redis-backed records (feature flags, lightweight config, session metadata).
Package info
github.com/polysource/adapter-redis
Type:symfony-bundle
pkg:composer/polysource/adapter-redis
Requires
- php: >=8.2
- polysource/core: ^0.1 || ^0.2 || ^0.3 || ^0.4 || ^0.5 || ^0.6 || ^0.7 || ^0.8 || ^0.9 || ^0.10 || ^0.11 || ^1.0
- symfony/config: ^6.4 || ^7.0 || ^8.0
- symfony/dependency-injection: ^6.4 || ^7.0 || ^8.0
- symfony/http-kernel: ^6.4 || ^7.0 || ^8.0
Requires (Dev)
- phpunit/phpunit: ^10.5 || ^11.5
- polysource/symfony-bundle: ^0.1 || ^0.2 || ^0.3 || ^0.4 || ^0.5 || ^0.6 || ^0.7 || ^0.8 || ^0.9 || ^0.10 || ^0.11 || ^1.0
- predis/predis: ^2.2
Suggests
- ext-redis: Native PHP Redis extension — alternative to Predis.
- predis/predis: Recommended client for the Redis adapter (^2.2). Hosts can also pass a native ext-redis client through a custom RedisHashClientInterface implementation.
This package is auto-updated.
Last update: 2026-08-07 15:37:33 UTC
README
Redis adapter for Polysource — admin feature flags, rate-limit buckets, workflow queues, leaderboards, cache entries. Covers all five Redis data types, one type-pure data source each.
Part of the Polysource monorepo. MIT-licensed.
What it ships
-
RedisClientInterface(21 methods) — abstraction over the Redis client used by the data sources, spanning the five supported types. Decouples from Predis/PhpRedis specifics.RedisHashClientInterfaceis the historical hashes-only name, kept as a deprecated alias that now extends the wider contract. -
PredisRedisClient— production implementation againstpredis/predis.PredisRedisHashClientis its hashes-scoped counterpart. -
Five type-pure data sources, each implementing
WritableDataSourceInterfaceover a key prefix and filtering client-side.search()walks the keyspace with repeatedSCAN(neverKEYS), sorts by id for stable ordering, then slices offset/limit in memory — the scan is capped at 50 iterations (~5 000 keys per namespace), so these are admin-sized collections, not unbounded ones:Data source One record is Exposed properties RedisHashDataSourceone hash key the hash fields themselves RedisListDataSourceone list key length,head,headPreview,ttlRedisSetDataSourceone set key cardinality,members,ttlRedisSortedSetDataSourceone sorted-set key cardinality,topMembers,topPreview,ttlRedisStringDataSourceone string key value,ttl -
Five matching resources —
RedisHashResource,RedisListResource,RedisSetResource,RedisSortedSetResource,RedisStringResource: non-final convenience bases, one subclass per Redis namespace you want to admin.
Install
composer require polysource/adapter-redis predis/predis
Register the bundle:
return [ Polysource\Adapter\Redis\PolysourceAdapterRedisBundle::class => ['all' => true], ];