cache_clear_all

  1. drupal
    1. drupal6 cache-install.inc
    2. drupal6
    3. drupal7 cache-install.inc
    4. drupal7
Versionen
drupal6 – drupal7 cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE)

Expire data from the cache. If called without arguments, expirable entries will be cleared from the cache_page and cache_block tables.

Übergabeparameter

$cid If set, the cache ID to delete. Otherwise, all cache entries that can expire are deleted.

$table If set, the table $table to delete from. Mandatory argument if $cid is set.

$wildcard If set to TRUE, the $cid is treated as a substring to match rather than a complete ID. The match is a right hand match. If '*' is given as $cid, the table $table will be emptied.

▾ 66 functions call cache_clear_all()

aggregator_aggregator_parse in modules/aggregator/aggregator.parser.inc
Implementation of hook_aggregator_parse().
block_add_block_form_submit in modules/block/block.admin.inc
Save the new custom block.
block_admin_configure_submit in modules/block/block.admin.inc
block_admin_display_form_submit in modules/block/block.admin.inc
Process main blocks administration form submissions.
block_box_delete_submit in modules/block/block.admin.inc
Deletion of custom blocks.
CacheClearCase::testClearCid in modules/simpletest/tests/cache.test
Test clearing using a cid.
CacheClearCase::testClearWildcard in modules/simpletest/tests/cache.test
Test clearing using wildcard.
CacheTestCase::generalWipe in modules/simpletest/tests/cache.test
Perform the general wipe.
cache_clear_all in includes/cache.inc
Expire data from the cache. If called without arguments, expirable entries will be cleared from the cache_page and cache_block tables.
comment_admin_overview_submit in modules/comment/comment.admin.inc
Process comment_admin_overview form submissions.
comment_confirm_delete_submit in modules/comment/comment.admin.inc
Process comment_confirm_delete form submissions.
comment_multiple_delete_confirm_submit in modules/comment/comment.admin.inc
Process comment_multiple_delete_confirm form submissions.
comment_save in modules/comment/comment.module
Accepts a submission of new or changed comment content.
drupal_flush_all_caches in includes/common.inc
Flush all cached data on the site.
drupal_process_form in includes/form.inc
This function is the heart of form API. The form gets built, validated and in appropriate cases, submitted.
drupal_theme_rebuild in includes/theme.inc
Force the system to rebuild the theme registry; this should be called when modules are added to the system, or when a dynamic system needs to add more theme hooks.
field_cache_clear in modules/field/field.module
Clear the cached information; called in several places when field information is changed.
filter_admin_configure_submit in modules/filter/filter.admin.inc
Clear the filter's cache when configuration settings are saved.
filter_admin_delete_submit in modules/filter/filter.admin.inc
Process filter delete form submission.
filter_admin_format_form_submit in modules/filter/filter.admin.inc
Process text format form submissions.
filter_admin_order_submit in modules/filter/filter.admin.inc
Process filter order configuration form submission.
filter_cron in modules/filter/filter.module
Implementation of hook_cron().
locale in modules/locale/locale.module
Provides interface translation services.
locale_languages_delete_form_submit in includes/locale.inc
Process language deletion submissions.
locale_languages_overview_form_submit in includes/locale.inc
Process language overview form submissions, updating existing languages.
locale_translate_delete_form_submit in includes/locale.inc
Process string deletion submissions.
locale_translate_edit_form_submit in includes/locale.inc
Process string editing form submissions.
menu_cache_clear in includes/menu.inc
Clears the cached cached data for a single named menu.
menu_cache_clear_all in includes/menu.inc
Clears all cached menu data. This should be called any time broad changes might have been made to the router items or menu links.
menu_delete_menu_confirm_submit in modules/menu/menu.admin.inc
Delete a custom menu and all links in it.
module_implements in includes/module.inc
Determine which modules are implementing a hook.
node_access_rebuild in modules/node/node.module
Rebuild the node access database. This is occasionally needed by modules that make system-wide changes to access levels.
node_admin_nodes_submit in modules/node/node.admin.inc
Process node_admin_nodes form submissions.
node_delete_multiple in modules/node/node.module
Delete multiple nodes.
node_save in modules/node/node.module
Save changes to a node or add a new node.
PathTestCase::testPathCache in modules/path/path.test
Test the path cache.
poll_vote in modules/poll/poll.module
Submit handler for processing a vote
profile_admin_overview_submit in modules/profile/profile.admin.inc
Submit handler to update changed profile field weights and categories.
profile_field_delete_submit in modules/profile/profile.admin.inc
Process a field delete form submission.
profile_field_form_submit in modules/profile/profile.admin.inc
Process profile_field_form submissions.
refreshVariables in modules/simpletest/drupal_web_test_case.php
Refresh the in-memory set of variables. Useful after a page request is made that changes a variable in a different thread.
simpletest_run_tests in modules/simpletest/simpletest.module
Actually runs tests.
system_cron in modules/system/system.module
Implementation of hook_cron().
system_modules in modules/system/system.admin.inc
Menu callback; provides module enable/disable interface.
system_settings_form_submit in modules/system/system.module
Execute the system_settings_form.
system_theme_settings_submit in modules/system/system.admin.inc
Process system_theme_settings form submissions.
taxonomy_term_delete in modules/taxonomy/taxonomy.module
Delete a term.
taxonomy_term_save in modules/taxonomy/taxonomy.module
Save a term object to the database.
taxonomy_vocabulary_delete in modules/taxonomy/taxonomy.module
Delete a vocabulary.
taxonomy_vocabulary_save in modules/taxonomy/taxonomy.module
Save a vocabulary given a vocabulary object.
update_info_page in ./update.php
user_admin_perm_submit in modules/user/user.admin.inc
Save permissions selected on the administer permissions page.
user_edit_submit in modules/user/user.pages.inc
user_profile_form_submit in modules/user/user.pages.inc
Submit function for the user account and profile editing form.
variable_del in includes/bootstrap.inc
Unset a persistent variable.
variable_set in includes/bootstrap.inc
Set a persistent variable.
_field_attach_delete in modules/field/field.attach.inc
Delete field data for an existing object. This deletes all revisions of field data for the object.
_field_attach_insert in modules/field/field.attach.inc
Save field data for a new object.
_field_attach_update in modules/field/field.attach.inc
Save field data for an existing object.
_field_info_collate_fields in modules/field/field.info.inc
Collate all information on existing fields and instances.
_field_info_collate_types in modules/field/field.info.inc
Collate all information on field types, widget types and related structures.
_locale_import_po in includes/locale.inc
Parses Gettext Portable Object file information and inserts into database
_menu_clear_page_cache in includes/menu.inc
Helper function to clear the page and block caches at most twice per page load.
_node_access_rebuild_batch_finished in modules/node/node.module
Post-processing for node_access_rebuild_batch.
_registry_rebuild in includes/registry.inc
_user_cancel in modules/user/user.module
Last batch processing step for cancelling a user account.

Code

includes/cache.inc, line 144

<?php
function cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE) {
  global $user;

  if (!isset($cid) && !isset($table)) {
    // 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;
  }

  if (empty($cid)) {
    if (variable_get('cache_lifetime', 0)) {
      // We store the time in the current user's $user->cache variable which
      // will be saved into the sessions table by _sess_write(). We then
      // simulate that the cache was flushed for this user by not returning
      // cached data that was cached before the timestamp.
      $user->cache = REQUEST_TIME;

      $cache_flush = variable_get('cache_flush_' . $table, 0);
      if ($cache_flush == 0) {
        // This is the first request to clear the cache, start a timer.
        variable_set('cache_flush_' . $table, REQUEST_TIME);
      }
      elseif (REQUEST_TIME > ($cache_flush + variable_get('cache_lifetime', 0))) {
        // Clear the cache for everyone, cache_lifetime seconds have
        // passed since the first request to clear the cache.
        db_delete($table)
          ->condition('expire', CACHE_PERMANENT, '<>')
          ->condition('expire', REQUEST_TIME, '<')
          ->execute();
        variable_set('cache_flush_' . $table, 0);
      }
    }
    else {
      // No minimum cache lifetime, flush all temporary cache entries now.
      db_delete($table)
        ->condition('expire', CACHE_PERMANENT, '<>')
        ->condition('expire', REQUEST_TIME, '<')
        ->execute();
    }
  }
  else {
    if ($wildcard) {
      if ($cid == '*') {
        db_truncate($table)->execute();
      }
      else {
        db_delete($table)
          ->condition('cid', $cid . '%', 'LIKE')
          ->execute();
      }
    }
    else {
      db_delete($table)
        ->condition('cid', $cid)
        ->execute();
    }
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen