mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge branch 'ticket/17358' into ticket/17358-master
This commit is contained in:
commit
89ce42ffa2
1 changed files with 9 additions and 7 deletions
16
phpBB/phpbb/cache/driver/redis.php
vendored
16
phpBB/phpbb/cache/driver/redis.php
vendored
|
@ -123,15 +123,17 @@ class redis extends \phpbb\cache\driver\memory
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* Store data in the cache
|
||||||
*/
|
*
|
||||||
|
* For the info, see https://phpredis.github.io/phpredis/Redis.html#method_set,
|
||||||
|
* https://redis.io/docs/latest/commands/set/
|
||||||
|
* and https://redis.io/docs/latest/commands/expire/#appendix-redis-expires
|
||||||
|
*
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
protected function _write(string $var, $data, int $ttl = 2592000): bool
|
protected function _write(string $var, $data, int $ttl = 2592000): bool
|
||||||
{
|
{
|
||||||
if ($ttl == 0)
|
return $this->redis->set($var, $data, ['EXAT' => time() + $ttl]);
|
||||||
{
|
|
||||||
return $this->redis->set($var, $data);
|
|
||||||
}
|
|
||||||
return $this->redis->setex($var, $ttl, $data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue