1 common.inc backdrop_delete_file_if_stale($uri)

Deletes files modified more than a set time ago.

Callback for file_scan_directory() within:

File

core/includes/common.inc, line 4172
Common functions that many Backdrop modules will need to reference.

Code

function backdrop_delete_file_if_stale($uri) {
  // Default stale file threshold is 30 days.
  if (REQUEST_TIME - filemtime($uri) > settings_get('stale_file_threshold', 2592000)) {
    file_unmanaged_delete($uri);
  }
}