CssCollectionOptimizer::generateHash

protected CssCollectionOptimizer::generateHash(array $css_group)

Generate a hash for a given group of CSS assets.

Parameters

array $css_group: A group of CSS assets.

Return value

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

File

core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php, line 157

Class

CssCollectionOptimizer
Optimizes CSS assets.

Namespace

Drupal\Core\Asset

Code

protected function generateHash(array $css_group) {
  $css_data = array();
  foreach ($css_group['items'] as $css_file) {
    $css_data[] = $css_file['data'];
  }
  return hash('sha256', serialize($css_data));
}
doc_Drupal
2016-10-29 08:59:15
Comments
Leave a Comment

Please login to continue.