1 update.module _update_cache_clear($cid = NULL, $wildcard = FALSE)

Invalidates cached data relating to update status.


$cid: (optional) Cache ID of the record to clear from the private update module cache. If empty, all records will be cleared from the table except fetch tasks. Defaults to NULL.

$wildcard: (optional) If TRUE, cache IDs starting with $cid are deleted in addition to the exact cache ID specified by $cid. Defaults to FALSE.

Related topics


core/modules/update/update.module, line 639
Handles update checking for Backdrop core and contributed projects.


function _update_cache_clear($cid = NULL, $wildcard = FALSE) {
  // When clearing caches via Admin Bar links, the string "update" is passed to
  // this function as $cid by the menu system.
  if (empty($cid) || $cid == 'update') {
      // Clear everything except fetch task information because these are used
      // to ensure that the fetch task queue items are not added multiple times.
      ->condition('cid', 'fetch_task::%', 'NOT LIKE')
  else {
    $query = db_delete('cache_update');
    if ($wildcard) {
      $query->condition('cid', $cid . '%', 'LIKE');
    else {
      $query->condition('cid', $cid);