cache_clear_all

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/cache.inc, строка 120

Версии
5 – 6
cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE)

Очищает кэш. Если вызывается без аргументов, то очищаются таблицы с кэшами страниц и блоков.

Параметры

$cid ID кэша для очистки. Если параметр не установлен, очищаются все записи кэша с истекшим сроком.

$table Таблица для очистки. Обязательный параметр, если установлен параметр $cid.

$wildcard Если установлено в TRUE, $cid используется как подстрока, соответствующая началу искомого ID кеша (т.е. 'photo' будет соответствовать 'photo_settings', 'photoset' и т.п.). Если этот параметр установлен как '*', то таблица кеша $table будет полностью очищена.

▾ 43 функции вызывают cache_clear_all()

aggregator_refresh in modules/aggregator/aggregator.module
Проверяет фид новостей на наличие новых пунктов.
block_admin_configure_submit in modules/block/block.module
block_admin_display_submit in modules/block/block.module
Process main block administration form submission.
block_box_delete_submit in modules/block/block.module
Удаляет блок, созданный пользователем.
cache_clear_all in includes/cache.inc
Очищает кэш. Если вызывается без аргументов, то очищаются таблицы с кэшами страниц и блоков.
comment_admin_overview_submit in modules/comment/comment.module
Execute the chosen 'Update option' on the selected comments, such as publishing, unpublishing or deleting.
comment_confirm_delete_submit in modules/comment/comment.module
comment_multiple_delete_confirm_submit in modules/comment/comment.module
Perform the actual comment deletion.
comment_save in modules/comment/comment.module
Сохраняет новый или измененный комментарий.
drupal_clear_css_cache in includes/common.inc
Удаляет все файлы кэша CSS.
filter_admin_configure_submit in modules/filter/filter.module
Clear the filter's cache when configuration settings are saved.
filter_admin_delete_submit in modules/filter/filter.module
Process filter delete form submission.
filter_admin_format_form_submit in modules/filter/filter.module
Process filter format form submissions.
filter_admin_order_submit in modules/filter/filter.module
Process filter order configuration form submission.
filter_cron in modules/filter/filter.module
Реализация hook_cron().
locale in modules/locale/locale.module
Provides interface translation services.
locale_admin_manage_delete_form_submit in modules/locale/locale.module
Process language deletion submissions.
menu_rebuild in includes/menu.inc
Заполняет данные, относящееся к меню в базе данных.
module_disable in includes/module.inc
Disable a given set of modules.
module_enable in includes/module.inc
Включает данный список модулей.
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.module
Submit the node administration update form.
node_delete in modules/node/node.module
Delete a node.
node_save in modules/node/node.module
Сохраняет ноду в базе данных.
poll_vote in modules/poll/poll.module
Callback for processing a vote
profile_field_delete_submit in modules/profile/profile.module
Process a field delete form submission.
profile_field_form_submit in modules/profile/profile.module
Process profile_field_form submissions.
system_theme_settings_submit in modules/system/system.module
system_update_1005 in modules/system/system.install
system_update_1011 in modules/system/system.install
system_update_113 in modules/system/system.install
taxonomy_del_term in modules/taxonomy/taxonomy.module
Удаляет термин.
taxonomy_del_vocabulary in modules/taxonomy/taxonomy.module
Удаляет указанный словарь.
taxonomy_save_term in modules/taxonomy/taxonomy.module
Вспомогательная функция для taxonomy_form_term_submit().
taxonomy_save_vocabulary in modules/taxonomy/taxonomy.module
throttle_exit in modules/throttle/throttle.module
Implementation of hook_exit().
update_do_updates in ./update.php
Perform updates for one second or until finished.
user_admin_account_submit in modules/user/user.module
Submit the user administration update form.
user_edit_submit in modules/user/user.module
variable_del in includes/bootstrap.inc
Удаляет хранимую переменную.
variable_set in includes/bootstrap.inc
Устанавливает постоянную переменную.
_locale_admin_manage_screen_submit in includes/locale.inc
Process locale admin manager form submissions.
_locale_import_po in includes/locale.inc
Parses Gettext Portable Object file information and inserts into database

Код

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

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

      $cache_flush = variable_get('cache_flush', 0);
      if ($cache_flush == 0) {
        // This is the first request to clear the cache, start a timer.
        variable_set('cache_flush', time());
      }
      else if (time() > ($cache_flush + variable_get('cache_lifetime', 0))) {
        // Clear the cache for everyone, cache_flush_delay seconds have
        // passed since the first request to clear the cache.
        db_query("DELETE FROM {". $table. "} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
        variable_set('cache_flush', 0);
      }
    }
    else {
      // No minimum cache lifetime, flush all temporary cache entries now.
      db_query("DELETE FROM {". $table. "} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
    }
  }
  else {
    if ($wildcard) {
      if ($cid == '*') {
        db_query("DELETE FROM {". $table. "}");
      }
      else {
        db_query("DELETE FROM {". $table. "} WHERE cid LIKE '%s%%'", $cid);
      }
    }
    else {
      db_query("DELETE FROM {". $table. "} WHERE cid = '%s'", $cid);
    }
  }
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему