Skip navigation
Help

drupal_delete_file_if_stale

7 common.inc drupal_delete_file_if_stale($uri)

Callback to delete files modified more than a set time ago.

2 string references to 'drupal_delete_file_if_stale'

File

drupal/includes/common.inc, line 3621
Common functions that many Drupal modules will need to reference.

Code

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