Generate a hash for a given group of JavaScript assets.

Paramètres

array $js_group: A group of JavaScript assets.

Return value

string A hash to uniquely identify the given group of JavaScript assets.

1 call to JsCollectionOptimizer::generateHash()
JsCollectionOptimizer::optimize dans src/Asset/JsCollectionOptimizer.php

Fichier

src/Asset/JsCollectionOptimizer.php, line 184

Classe

JsCollectionOptimizer

Namespace

Drupal\advagg\Asset

Code

protected function generateHash(array $js_group) {
    $js_data = [];
    foreach ($js_group['items'] as $js_file) {
        $js_data[] = $js_file['data'];
        $js_data[] = filemtime($js_file['data']);
    }
    return hash('sha256', serialize($js_data));
}