You are here

function advagg_get_files_in_bundle in Advanced CSS/JS Aggregation 6

Same name and namespace in other branches
  1. 7 advagg.module \advagg_get_files_in_bundle()

Get list of files and the filetype given a bundle md5.

Parameters

$bundle_md5: Bundle's machine name.

Return value

array ($filetype, $files)

2 calls to advagg_get_files_in_bundle()
advagg_cached_bundle_get in ./advagg.module
Get a bundle from the cache & verify it is good.
advagg_rebuild_bundle in ./advagg.module
Rebuild a bundle.

File

./advagg.module, line 1706
Advanced CSS/JS aggregation module

Code

function advagg_get_files_in_bundle($bundle_md5) {
  $files = array();
  $filetype = NULL;
  $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'];
    $filetype = $row['filetype'];
  }
  return array(
    $filetype,
    $files,
  );
}