function drupal_delete_file_if_stale

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

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);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.