You are here

function advagg_flush_caches in Advanced CSS/JS Aggregation 7.2

Same name and namespace in other branches
  1. 6 advagg.module \advagg_flush_caches()
  2. 7 advagg.module \advagg_flush_caches()

Implements hook_flush_caches().

2 calls to advagg_flush_caches()
advagg_cache_clear_admin_submit in ./advagg.module
Clear certain caches on form submit.
advagg_flush_all_cache_bins in ./advagg.cache.inc
Perform a cache_clear_all on all bins returned by advagg_flush_caches(TRUE).

File

./advagg.module, line 1009
Advanced CSS/JS aggregation module.

Code

function advagg_flush_caches($all_bins = FALSE, $push_new_changes = TRUE) {

  // * @param bool $all_bins
  // *   TRUE: Get all advagg cache bins.
  // * @param bool $push_new_changes
  // *   FALSE: Do not scan for changes.
  //
  // Send back a blank array if aav table doesn't exist.
  if (!db_table_exists('advagg_aggregates_versions')) {
    return array();
  }

  // Scan for and push new changes.
  module_load_include('inc', 'advagg', 'advagg.cache');
  if ($push_new_changes) {
    advagg_push_new_changes();
  }

  // Get list of cache bins to clear.
  $bins = array(
    'cache_advagg_aggregates',
  );
  if ($all_bins) {
    $bins[] = 'cache_advagg_info';
  }
  return $bins;
}