Commit 245db071 authored by Dries's avatar Dries

- Patch #1275808 by bfroehle: use new cache bin naming in hook_flush_cache().

parent 849860fb
......@@ -7146,10 +7146,10 @@ function drupal_flush_all_caches() {
// Don't clear cache_form - in-progress form submissions may break.
// Ordered so clearing the page cache will always be the last action.
$core = array('cache', 'cache_path', 'cache_filter', 'cache_bootstrap', 'cache_page');
$cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
foreach ($cache_tables as $table) {
cache($table)->flush();
$core = array('cache', 'path', 'filter', 'bootstrap', 'page');
$cache_bins = array_merge(module_invoke_all('flush_caches'), $core);
foreach ($cache_bins as $bin) {
cache($bin)->flush();
}
// Rebuild the bootstrap module list. We do this here so that developers
......
......@@ -912,7 +912,7 @@ function block_flush_caches() {
_block_rehash($theme->name);
}
return array('cache_block');
return array('block');
}
/**
......
......@@ -421,7 +421,7 @@ function field_system_info_alter(&$info, $file, $type) {
*/
function field_flush_caches() {
field_sync_field_status();
return array('cache_field');
return array('field');
}
/**
......
......@@ -262,7 +262,7 @@ function image_system_file_system_settings_submit($form, &$form_state) {
* Implements hook_flush_caches().
*/
function image_flush_caches() {
return array('cache_image');
return array('image');
}
/**
......
......@@ -2377,17 +2377,17 @@ function hook_mail($key, &$message, $params) {
/**
* Add a list of cache tables to be cleared.
*
* This hook allows your module to add cache table names to the list of cache
* tables that will be cleared by the Clear button on the Performance page or
* This hook allows your module to add cache bins to the list of cache bins
* that will be cleared by the Clear button on the Performance page or
* whenever drupal_flush_all_caches is invoked.
*
* @return
* An array of cache table names.
* An array of cache bins.
*
* @see drupal_flush_all_caches()
*/
function hook_flush_caches() {
return array('cache_example');
return array('example');
}
/**
......
......@@ -3004,10 +3004,10 @@ function system_cron() {
}
}
$core = array('cache', 'cache_path', 'cache_filter', 'cache_page', 'cache_form', 'cache_menu');
$cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
foreach ($cache_tables as $table) {
cache($table)->expire();
$core = array('cache', 'path', 'filter', 'page', 'form', 'menu');
$cache_bins = array_merge(module_invoke_all('flush_caches'), $core);
foreach ($cache_bins as $bin) {
cache($bin)->expire();
}
// Cleanup the batch table and the queue for failed batches.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment