function drupal_delete_file_if_stale

7.x 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'
drupal_clear_css_cache in drupal-7.x/includes/common.inc
Deletes old cached CSS files.
drupal_clear_js_cache in drupal-7.x/includes/common.inc
Deletes old cached JavaScript files and variables.

File

drupal-7.x/includes/common.inc, line 3791
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);
  }
}