Do not use call _cache_get_object() to clear cache

Created on 16 July 2024, 5 months ago
Updated 30 July 2024, 5 months ago

The currently used code is the following one.

foreach ($clears as $bin => $cids) {
  $cache = _cache_get_object($bin);
  foreach ($cids as $serialized_cid => $wildcard) {
    $cache->clear(unserialize($serialized_cid), $wildcard);
  }
}

Instead of calling a function, and then a method on the returned object, it sufficient to call cache_clear_all().

foreach ($clears as $bin => $cids) {
  foreach ($cids as $serialized_cid => $wildcard) {
    cache_clear_all(unserialize($serialized_cid), $bin, $wildcard);
  }
}
📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇹Italy apaderno Brescia, 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024