Same name and namespace in other branches
  1. 4.6.x includes/bootstrap.inc \cache_clear_all()
  2. 4.7.x includes/bootstrap.inc \cache_clear_all()
  3. 5.x includes/cache.inc \cache_clear_all()
  4. 6.x includes/cache.inc \cache_clear_all()
  5. 6.x includes/cache-install.inc \cache_clear_all()

Expires data from the cache.

If called with the arguments $cid and $bin set to NULL or omitted, then expirable entries will be cleared from the cache_page and cache_block bins, and the $wildcard argument is ignored.

Parameters

$cid: If set, the cache ID or an array of cache IDs. Otherwise, all cache entries that can expire are deleted. The $wildcard argument will be ignored if set to NULL.

$bin: If set, the cache bin to delete from. Mandatory argument if $cid is set.

$wildcard: If TRUE, the $cid argument must contain a string value and cache IDs starting with $cid are deleted in addition to the exact cache ID specified by $cid. If $wildcard is TRUE and $cid is '*', the entire cache is emptied.

82 calls to cache_clear_all()
aggregator_aggregator_parse in modules/aggregator/aggregator.parser.inc
Implements hook_aggregator_parse().
AnnounceFeedTestInvalidJsonTestCase::testInvalidFeedResponse in modules/announcements_feed/tests/announce_feed_test.test
Test the announcements feed with invalid JSON or non-existing JSON URL.
AnnounceFeedTestValidateJsonFeed::testAnnounceFeedEmpty in modules/announcements_feed/tests/announce_feed_test.test
Check the status of the feed with an empty JSON feed.
AnnounceFeedTestValidateJsonFeed::testAnnounceFeedUpdatedAndRemoved in modules/announcements_feed/tests/announce_feed_test.test
Testing the feed with Updated and Removed JSON feeds.
BlockCacheTestCase::testCachePerRole in modules/block/block.test
Test DRUPAL_CACHE_PER_ROLE.

... See full list

2 string references to 'cache_clear_all'
menu_cache_clear in includes/menu.inc
Clears the cached data for a single named menu.
_menu_clear_page_cache in includes/menu.inc
Clears the page and block caches at most twice per page load.

File

includes/cache.inc, line 163
Functions and interfaces for cache handling.

Code

function cache_clear_all($cid = NULL, $bin = NULL, $wildcard = FALSE) {
  if (!isset($cid) && !isset($bin)) {

    // Clear the block cache first, so stale data will
    // not end up in the page cache.
    if (module_exists('block')) {
      cache_clear_all(NULL, 'cache_block');
    }
    cache_clear_all(NULL, 'cache_page');
    return;
  }
  return _cache_get_object($bin)
    ->clear($cid, $wildcard);
}