You are here

function _minify_clear_invalid_cache in Minify 7

Helper function to clear invalid cache check original file is exist or not if not, delete minified file and remove record from cache

3 calls to _minify_clear_invalid_cache()
minify_cron in ./minify.module
Implements hook_cron().
minify_js_callback in ./minify.admin.inc
Menu callback to generate overview form
minify_update_7104 in ./minify.install
Update module weight, minify cache info and re-generate minified files if require

File

./minify.admin.inc, line 376

Code

function _minify_clear_invalid_cache() {
  $cache = variable_get('minify_captured_js', array());
  foreach ($cache as $key => $value) {
    if (!file_exists($key)) {
      if (file_exists($value['minified_file_path'])) {
        drupal_unlink($value['minified_file_path']);
      }
      unset($cache[$key]);
    }
  }
  variable_set('minify_captured_js', $cache);
}