- Issue created by @lamp5
All media_download_all: cache tags should be invalidate during media deletion.
public function invalidateTags() {
$connectionSettings = Database::getConnection();
$prefix = $connectionSettings->getConnectionOptions()['prefix'];
$tags = $this->database->query("SELECT * FROM {$prefix}cache_default WHERE cid LIKE '%media_download_all:%'")
->fetchAll();
foreach ($tags as $tag) {
$cid = $tag->cid;
$cache = $this->cache->get($cid);
if ($cache) {
$cached_files = $cache->data;
if (!empty($cached_files)) {
foreach ($cached_files as $file) {
unlink($file);
}
}
$this->cache->delete($cid);
}
}
}
Active
2.0
Code