You are here

public function CToolsCssCache::clear in Chaos Tool Suite (ctools) 7

Expires data from the cache.

If called without arguments, expirable entries will be cleared from the cache_page and cache_block bins.

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.

$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.

Overrides DrupalCacheInterface::clear

File

includes/css-cache.inc, line 13
Custom cache implementation for the CTools CSS cache.

Class

CToolsCssCache
@file Custom cache implementation for the CTools CSS cache.

Code

public function clear($cid = NULL, $wildcard = FALSE) {

  // Only clear the caches if the wildcard is set, this ensures that the cache
  // is only cleared when the full caches are cleared manually (eg by invoking
  // drupal_flush_all_caches()), and not on a cron run.
  // @see drupal_flush_all_caches()
  // @see system_cron()
  if ($wildcard) {
    ctools_include('css');
    ctools_css_flush_caches();
  }
}