You are here

function advagg_missing_remove_cache in Advanced CSS/JS Aggregation 6

Same name and namespace in other branches
  1. 7 includes/missing.inc \advagg_missing_remove_cache()

Set cache value to FALSE.

Parameters

$bundle_md5: Bundle's machine name.

1 call to advagg_missing_remove_cache()
advagg_missing_regenerate in ./advagg.missing.inc
regenerates a missing css file.

File

./advagg.missing.inc, line 184
Advanced aggregation module; 404 handler.

Code

function advagg_missing_remove_cache($bundle_md5) {
  $files = array();
  $results = db_query("SELECT filename, filetype FROM {advagg_files} AS af INNER JOIN {advagg_bundles} AS ab USING ( filename_md5 ) WHERE bundle_md5 = '%s' ORDER BY porder ASC", $bundle_md5);
  while ($row = db_fetch_array($results)) {
    $files[] = $row['filename'];
    $type = $row['filetype'];
  }
  list($css_path, $js_path) = advagg_get_root_files_dir();
  if ($type == 'js') {
    $file_type_path = $js_path;
  }
  if ($type == 'css') {
    $file_type_path = $css_path;
  }
  $filenames = advagg_get_filename($files, $type, '', $bundle_md5);
  if (!empty($filenames)) {
    foreach ($filenames as $key => $info) {
      $filename = $info['filename'];
      $filepath = $file_type_path . '/' . $filename;
      cache_set($filepath, FALSE, 'cache_advagg', TRUE);
    }
  }
}