function 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).

2 calls to drupal_file_scan_write_cache()
BootstrapGetFilenameWebTestCase::testDrupalGetFilename in drupal/modules/simpletest/tests/bootstrap.test
Test that drupal_get_filename() works correctly with a full Drupal site.
drupal_page_footer in drupal/includes/common.inc
Performs end-of-request tasks.

File

drupal/includes/bootstrap.inc, line 1154
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');
  }
}