forked from leftypol/leftypol
RedisCacheDriver.php: add false value support
This commit is contained in:
parent
9b5906effe
commit
8b586dc3bb
1 changed files with 4 additions and 0 deletions
|
@ -29,10 +29,14 @@ class RedisCacheDriver implements CacheDriver {
|
|||
if ($ret === false) {
|
||||
return null;
|
||||
}
|
||||
if ($ret === null) {
|
||||
return false;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function set(string $key, mixed $value, mixed $expires = false): void {
|
||||
$value = $value === false ? null : $value;
|
||||
if ($expires === false) {
|
||||
$this->inner->set($this->prefix . $key, $value);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue