You are here

function _admin_menu_flush_cache in Administration menu 7.3

Same name and namespace in other branches
  1. 8.3 admin_menu.inc \_admin_menu_flush_cache()
  2. 6.3 admin_menu.inc \_admin_menu_flush_cache()

Flush all caches or a specific one.

Parameters

$name: (optional) Name of cache to flush.

See also

system_admin_menu_cache_info()

2 string references to '_admin_menu_flush_cache'
admin_menu_admin_menu_cache_info in ./admin_menu.inc
Implements hook_admin_menu_cache_info().
system_admin_menu_cache_info in ./admin_menu.inc
Implements hook_admin_menu_cache_info() on behalf of System module.

File

./admin_menu.inc, line 908
Menu builder functions for Administration menu.

Code

function _admin_menu_flush_cache($name = NULL) {
  switch ($name) {
    case 'admin_menu':
      admin_menu_flush_caches();
      break;
    case 'menu':
      menu_rebuild();
      break;
    case 'registry':
      registry_rebuild();

    // Fall-through to clear cache tables, since registry information is
    // usually the base for other data that is cached (e.g. SimpleTests).
    case 'cache':

      // Don't clear cache_form - in-progress form submissions may break.
      // Ordered so clearing the page cache will always be the last action.
      // @see drupal_flush_all_caches()
      $core = array(
        'cache',
        'cache_bootstrap',
        'cache_filter',
        'cache_page',
      );
      $cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
      foreach ($cache_tables as $table) {
        cache_clear_all('*', $table, TRUE);
      }
      break;
    case 'assets':

      // Change query-strings on css/js files to enforce reload for all users.
      _drupal_flush_css_js();
      drupal_clear_css_cache();
      drupal_clear_js_cache();

      // Clear the page cache, since cached HTML pages might link to old CSS and
      // JS aggregates.
      cache_clear_all('*', 'cache_page', TRUE);
      break;
    case 'theme':
      system_rebuild_theme_data();
      drupal_theme_rebuild();
      break;
  }
}