You are here

function advagg_mod_advagg_get_info_on_files_alter in Advanced CSS/JS Aggregation 7.2

Implements hook_advagg_get_info_on_files_alter().

Used to make sure the info is up to date in the cache.

Related topics

File

advagg_mod/advagg_mod.advagg.inc, line 18
Advanced CSS/JS aggregation modifier module.

Code

function advagg_mod_advagg_get_info_on_files_alter(&$return, $cached_data, $bypass_cache) {
  foreach ($return as &$info) {
    if (empty($info['fileext']) || $info['fileext'] !== 'js') {
      continue;
    }

    // New or updated data or no advagg_js_compress data.
    if (empty($cached_data[$info['cache_id']]) || empty($info['advagg_mod']) || $info['content_hash'] != $cached_data[$info['cache_id']]['content_hash']) {

      // Check the cache.
      $info['advagg_mod'] = advagg_mod_js_contains_jquery_drupal($info['data']);
    }
  }
  unset($info);
}