You are here

function advagg_admin_clear_all_caches_button in Advanced CSS/JS Aggregation 7.2

Clear out all advagg cache bins.

Related topics

4 calls to advagg_admin_clear_all_caches_button()
advagg_admin_increment_global_counter in ./advagg.admin.inc
Clear out all advagg cache bins and increment the counter.
advagg_admin_remove_empty_advagg_files in ./advagg.admin.inc
Remove filesize zero files from the advagg_files table and clear caches.
advagg_admin_reset_mtime in ./advagg.admin.inc
Clear out all advagg cache bins and increment the counter.
advagg_admin_truncate_advagg_files in ./advagg.admin.inc
Truncate the advagg_files table and clear caches.
1 string reference to 'advagg_admin_clear_all_caches_button'
advagg_admin_operations_form in ./advagg.admin.inc
Form builder; Do advagg operations.

File

./advagg.admin.inc, line 1629
Admin page callbacks for the advanced CSS/JS aggregation module.

Code

function advagg_admin_clear_all_caches_button() {

  // Clear the libraries cache.
  if (function_exists('libraries_flush_caches')) {
    $cache_tables = libraries_flush_caches();
    foreach ($cache_tables as $table) {
      cache_clear_all('*', $table, TRUE);
    }
  }

  // Run the command.
  module_load_include('inc', 'advagg', 'advagg.cache');
  advagg_flush_all_cache_bins();

  // Report back the results.
  drupal_set_message(t('All AdvAgg cache bins have been cleared.'));

  // Clear it again at the end of the request to be sure.
  drupal_register_shutdown_function('advagg_flush_all_cache_bins', FALSE);
  drupal_register_shutdown_function('advagg_push_new_changes');
}