The Redis cache backend.
This is a nice, reliable caching backend that allows for clustering using the Redis clustering feature.
Available config options:
- server - The redis server to connect to. Currently only a single server is supported. Default: localhost.
- port - The port to connect to the server on. Default: 6379
protected int $weight = 2
private string $delim = '"\r\n"'
private bool $updateExpire
public init(string $namespace): void
Parameter | Type | Description |
---|
$namespace | string | |
public cmd(array $cmds, bool $useMaster = false): mixed
Parameter | Type | Description |
---|
$cmds | array | |
$useMaster | bool | |
public select(int $db): bool
Parameter | Type | Description |
---|
$db | int | |
public has(string $key, bool $checkEmpty = false): bool
Parameter | Type | Description |
---|
$key | string | |
$checkEmpty | bool | |
public get(string $key): mixed
Parameter | Type | Description |
---|
$key | string | |
public set(string $key, mixed $value, int $timeout = 0): bool
Parameter | Type | Description |
---|
$key | string | |
$value | mixed | |
$timeout | int | |
public remove(string $key): bool
Parameter | Type | Description |
---|
$key | string | |
private connect(string $host, int $port = 6379): Client
Parameter | Type | Description |
---|
$host | string | |
$port | int | |
private getChunk(Client $socket, ?int $bytes): string
Parameter | Type | Description |
---|
$socket | Client | |
$bytes | int | |
Decodes a RESP data chunk.
private decode(Client $socket, ?string $chunk): mixed
Parameter | Type | Description |
---|
$socket | Client | |
$chunk | string | |
Encodes data into the RESP protocol.
private encode(mixed $data): void
Parameter | Type | Description |
---|
$data | mixed | The data to encode |
private keepalive(): void
Generated by Hazaar API Doc Generator