You are here

function _update_cache_clear in Drupal 7

Same name and namespace in other branches
  1. 6 modules/update/update.module \_update_cache_clear()

Invalidates cached data relating to update status.

Parameters

$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

10 calls to _update_cache_clear()
hook_themes_disabled in modules/system/theme.api.php
Respond to themes being disabled.
UpdateCoreTestCase::testFetchTasks in modules/update/update.test
Tests that exactly one fetch task per project is created and not more.
update_cache_clear_submit in modules/update/update.module
Form submission handler for system_modules().
update_flush_caches in modules/update/update.module
Implements hook_flush_caches().
update_project_cache in modules/update/update.compare.inc
Retrieves data from {cache_update} or empties the cache when necessary.

... See full list

File

modules/update/update.module, line 849
Handles updates of Drupal core and contributed projects.

Code

function _update_cache_clear($cid = NULL, $wildcard = FALSE) {
  if (empty($cid)) {
    db_delete('cache_update')
      ->condition('cid', 'fetch_task::%', 'NOT LIKE')
      ->execute();
  }
  else {
    $query = db_delete('cache_update');
    if ($wildcard) {
      $query
        ->condition('cid', $cid . '%', 'LIKE');
    }
    else {
      $query
        ->condition('cid', $cid);
    }
    $query
      ->execute();
  }
}