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

File

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