You are here

function hook_advagg_bundler_analysis_alter in Advanced CSS/JS Aggregation 8.2

Same name and namespace in other branches
  1. 7.2 advagg.api.php \hook_advagg_bundler_analysis_alter()

Let other modules modify the analysis array before it is used.

Parameters

array $analysis: An associative array; filename -> data.

See also

advagg_bundler_analysis()

Related topics

File

./advagg.api.php, line 181
Hooks provided by the AdvAgg module.

Code

function hook_advagg_bundler_analysis_alter(array &$analysis) {
  foreach ($analysis as $filename => &$data) {
    if ($filename) {

      // This is the filename.
    }

    // This changes often; 604800 is 1 week.
    if ($data['changes'] > 10 && $data['mtime'] >= REQUEST_TIME - 604800) {

      // Modify the group hash so this doesn't end up in a big aggregate.
      $data['group_hash'];
    }
  }
  unset($data);
}