PhpRedisSessionClient
final class PhpRedisSessionClient implements RedisSessionClientInterface (View source)
| internal |
Normalizes phpredis return values for the session storage lifecycle.
Methods
Creates the native client only when the optional Redis extension is available.
Opens the native Redis connection.
Authenticates the native Redis connection.
Selects the configured logical Redis database.
Returns only string payloads and maps absent keys to null.
Normalizes phpredis integer and boolean existence replies.
Reports whether Redis renewed the requested key.
Stores the payload only when phpredis confirms success.
Treats both deletion and an already absent key as a successful command.
Closes the native connection without exposing its return convention.
Details
__construct
__construct()
Creates the native client only when the optional Redis extension is available.
connect
bool
connect(string $host, int $port, float $timeout)
Opens the native Redis connection.
authenticate
bool
authenticate(string $password)
Authenticates the native Redis connection.
selectDatabase
bool
selectDatabase(int $database)
Selects the configured logical Redis database.
get
string|null
get(string $key)
Returns only string payloads and maps absent keys to null.
exists
bool
exists(string $key)
Normalizes phpredis integer and boolean existence replies.
expire
bool
expire(string $key, int $seconds)
Reports whether Redis renewed the requested key.
setex
bool
setex(string $key, int $seconds, string $payload)
Stores the payload only when phpredis confirms success.
delete
bool
delete(string $key)
Treats both deletion and an already absent key as a successful command.
close
void
close()
Closes the native connection without exposing its return convention.