Esc
API Index — Namespaces, Packages, Reports, Indices
DriverPreference
: string
in package
Type-safe enum for RedisClient's driver selection. Accepted by
Store::defaultBackend() via the 'prefer' opt and by
RedisClient::__construct()'s opts array.
Store::defaultBackend(StoreBackendKind::Redis, [
'prefer' => DriverPreference::Predis, // typed form
]);
// or the BC string form:
Store::defaultBackend('redis', ['prefer' => 'predis']);
Table of Contents
Cases
- Auto = 'auto'
- Auto-detect: prefer
ext-redis(phpredis) when loaded, fall back to predis. - Phpredis = 'phpredis'
- Force the
ext-redis(phpredis) extension. Throws if not loaded. - Predis = 'predis'
- Force the pure-PHP predis library.
Methods
- coerce() : self
- Coerce a string or existing
DriverPreferencecase to aDriverPreference.
Cases
Auto
Auto-detect: prefer ext-redis (phpredis) when loaded, fall back to predis.
Phpredis
Force the ext-redis (phpredis) extension. Throws if not loaded.
Predis
Force the pure-PHP predis library.
Methods
coerce()
Coerce a string or existing DriverPreference case to a DriverPreference.
public
static coerce(self|string $pref) : self
Accepts 'auto', 'phpredis', or 'predis' (case-insensitive).
Parameters
- $pref : self|string