Commit 245db071 authored by Dries's avatar Dries
Browse files

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

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