You are here

function libraries_flush_caches in Libraries API 7.2

Same name and namespace in other branches
  1. 7.3 libraries.module \libraries_flush_caches()

Implements hook_flush_caches().

1 call to libraries_flush_caches()
libraries_cache_clear in ./libraries.module
Clears the cached library information.

File

./libraries.module, line 11
External library handling for Drupal modules.

Code

function libraries_flush_caches() {

  // Clear static caches.
  // We don't clear the 'libraries_load' static cache, because that could result
  // in libraries that had been loaded before the cache flushing to be loaded
  // again afterwards.
  foreach (array(
    'libraries_get_path',
    'libraries_info',
  ) as $name) {
    drupal_static_reset($name);
  }

  // @todo When upgrading from 1.x, update.php attempts to flush caches before
  //   the cache table has been created.
  // @see http://drupal.org/node/1477932
  if (db_table_exists('cache_libraries')) {
    return array(
      'cache_libraries',
    );
  }
}