W3cubDocs

/Drupal 8

function update_clear_update_disk_cache

update_clear_update_disk_cache()

Clears the temporary files and directories based on file age from disk.

File

core/modules/update/update.module, line 707
Handles updates of Drupal core and contributed projects.

Code

function update_clear_update_disk_cache() {
  // List of update module cache directories. Do not create the directories if
  // they do not exist.
  $directories = array(
    _update_manager_cache_directory(FALSE),
    _update_manager_extract_directory(FALSE),
  );

  // Search for files and directories in base folder only without recursion.
  foreach ($directories as $directory) {
    file_scan_directory($directory, '/.*/', array('callback' => 'update_delete_file_if_stale', 'recurse' => FALSE));
  }
}

© 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/core!modules!update!update.module/function/update_clear_update_disk_cache/8.1.x