function drupal_file_scan_write_cache

drupal_file_scan_write_cache()

Writes the file scan cache to the persistent cache.

This cache stores all files marked as missing or moved after a file scan to prevent unnecessary file scans in subsequent requests. This cache is cleared in system_list_reset() (i.e. after a module/theme rebuild).

File

includes/bootstrap.inc, line 1139
Functions that need to be loaded on every Drupal request.

Code

function drupal_file_scan_write_cache() {
  // Only write to the persistent cache if requested, and if we know that any
  // data previously in the cache was successfully loaded and merged in by
  // _drupal_file_scan_cache().
  $file_scans = &_drupal_file_scan_cache();
  if (isset($file_scans['#write_cache']) && isset($file_scans['#cache_merge_done'])) {
    unset($file_scans['#write_cache']);
    cache_set('_drupal_file_scan_cache', $file_scans, 'cache_bootstrap');
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/drupal_file_scan_write_cache/7.x