Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions includes/module.inc
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ function module_implements($hook, $sort = FALSE, $refresh = FALSE) {

if ($refresh) {
$implementations = array();
cache_clear_all('system_cache_tables', 'cache');
return;
}

Expand Down
17 changes: 15 additions & 2 deletions modules/system/system.module
Original file line number Diff line number Diff line change
Expand Up @@ -1327,8 +1327,21 @@ function system_cron() {
}
db_query('DELETE FROM {files} WHERE fid = %d', $file->fid);
}
$core = array('cache', 'cache_block', 'cache_filter', 'cache_page', 'cache_form', 'cache_menu');
$cache_tables = array_merge(module_invoke_all('flush_caches'), $core);

// Delete expired cache entries.
// Avoid invoking hook_flush_cashes() on every cron run because some modules
// use this hook to perform expensive rebuilding operations (which are only
// designed to happen on full cache clears), rather than just returning a
// list of cache tables to be cleared.
$cache_object = cache_get('system_cache_tables');
if (empty($cache_object)) {
$core = array('cache', 'cache_block', 'cache_filter', 'cache_page', 'cache_form', 'cache_menu');
$cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
cache_set('system_cache_tables', $cache_tables);
}
else {
$cache_tables = $cache_object->data;
}
foreach ($cache_tables as $table) {
cache_clear_all(NULL, $table);
}
Expand Down