mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-02 12:57:35 +01:00
RedisCacheDriver.php: fixup
This commit is contained in:
parent
5a3fead579
commit
b7a9f47a1b
@ -8,7 +8,7 @@ class RedisCacheDriver implements CacheDriver {
|
|||||||
private string $prefix;
|
private string $prefix;
|
||||||
private \Redis $inner;
|
private \Redis $inner;
|
||||||
|
|
||||||
public function __construct(string $prefix, string $host, ?int $port, ?string $password, string $database) {
|
public function __construct(string $prefix, string $host, ?int $port, ?string $password, int $database) {
|
||||||
$this->inner = new \Redis();
|
$this->inner = new \Redis();
|
||||||
if (str_starts_with($host, 'unix:') || str_starts_with($host, ':')) {
|
if (str_starts_with($host, 'unix:') || str_starts_with($host, ':')) {
|
||||||
$ret = \explode(':', $host);
|
$ret = \explode(':', $host);
|
||||||
@ -30,10 +30,10 @@ class RedisCacheDriver implements CacheDriver {
|
|||||||
throw new \RuntimeException('Unable to configure Redis serializer');
|
throw new \RuntimeException('Unable to configure Redis serializer');
|
||||||
}
|
}
|
||||||
if (!$this->inner->select($database)) {
|
if (!$this->inner->select($database)) {
|
||||||
throw new \RuntimeException('Unable to connect to Redis!');
|
throw new \RuntimeException('Unable to connect to Redis database!');
|
||||||
}
|
}
|
||||||
|
|
||||||
$$this->prefix = $prefix;
|
$this->prefix = $prefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get(string $key): mixed {
|
public function get(string $key): mixed {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user