Commit e4d4d58c authored by amanaplan's avatar amanaplan Committed by tstoeckler

Issue #2823735 by amanaplan, tstoeckler: Add admin_menu cache clear

integration.
parent 50761ca8
Libraries 7.x-2.x, xxxx-xx-xx
-----------------------------
#2823735 by amanaplan, tstoeckler: Add admin_menu cache clear integration.
#2745763 by Albert Volkman, tstoeckler: Allow downloading all libraries at once.
#2310753 by tstoeckler: Avoid libraries_get_libraries() scanning the root.
#2341955 by sadashiv, tstoeckler: Clear library cache on library report.
......
......@@ -124,9 +124,7 @@ function libraries_admin_overview(array $form, array &$form_state) {
// it was just downloaded. Because these instructions use libraries_detect()
// directly, they will never use the cached information, but this avoids the
// overview showing a library as installed but it not being loadable.
foreach (libraries_flush_caches() as $bin) {
cache_clear_all(NULL, $bin);
}
libraries_cache_clear();
return $form;
}
......
......@@ -44,10 +44,7 @@ function libraries_drush_cache_clear(array &$types) {
* Clears the library cache.
*/
function libraries_drush_invalidate_cache() {
// @see drupal_flush_all_caches()
foreach (libraries_flush_caches() as $table) {
cache_clear_all('*', $table, TRUE);
}
libraries_cache_clear();
}
/**
......
......@@ -25,6 +25,29 @@ function libraries_flush_caches() {
}
}
/**
* Implements hook_admin_menu_cache_info().
*/
function libraries_admin_menu_cache_info() {
$caches['libraries'] = array(
'title' => t('Libraries'),
'callback' => 'libraries_cache_clear',
);
return $caches;
}
/**
* Clears the cached library information.
*/
function libraries_cache_clear() {
foreach (libraries_flush_caches() as $bin) {
// Using the wildcard argument leads to DrupalDatabaseCache::clear()
// truncating the libraries cache table which is more performant that
// deleting the rows.
cache_clear_all('*', $bin, TRUE);
}
}
/**
* Gets the path of a library.
*
......
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