diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php index 0a4ea304ad..4ccd0607cd 100644 --- a/phpBB/phpbb/cache/driver/memory.php +++ b/phpBB/phpbb/cache/driver/memory.php @@ -45,6 +45,30 @@ abstract class memory extends \phpbb\cache\driver\base } } + /** + * {@inheritDoc} + */ + function purge() + { + unset($this->vars); + unset($this->sql_rowset); + unset($this->sql_row_pointer); + + if (function_exists('opcache_reset')) + { + @opcache_reset(); + } + + $this->vars = []; + $this->sql_rowset = []; + $this->sql_row_pointer = []; + + $this->is_modified = true; + + // We save here to let the following cache hits succeed + $this->save(); + } + /** * {@inheritDoc} */ diff --git a/phpBB/phpbb/cache/driver/redis.php b/phpBB/phpbb/cache/driver/redis.php index 6f103bf0f0..5a8332a15b 100644 --- a/phpBB/phpbb/cache/driver/redis.php +++ b/phpBB/phpbb/cache/driver/redis.php @@ -141,7 +141,7 @@ class redis extends \phpbb\cache\driver\memory */ protected function _delete(string $var): bool { - if ($this->redis->delete($var) > 0) + if ($this->redis->del($var) > 0) { return true; }