You are here

protected function AssetOptimizer::shouldBrotli in Advanced CSS/JS Aggregation 8.3

Same name and namespace in other branches
  1. 8.4 src/Asset/AssetOptimizer.php \Drupal\advagg\Asset\AssetOptimizer::shouldBrotli()

Determine if settings and available PHP modules allow brotli-ing assets.

Return value

bool True if asset type can/should be brotli-ed.

1 call to AssetOptimizer::shouldBrotli()
AssetOptimizer::__construct in src/Asset/AssetOptimizer.php
Constructs the Optimizer object.

File

src/Asset/AssetOptimizer.php, line 306

Class

AssetOptimizer
Defines the base AdvAgg optimizer.

Namespace

Drupal\advagg\Asset

Code

protected function shouldBrotli() {
  if (function_exists('brotli_compress') && $this->config
    ->get($this->extension . '.brotli')) {
    return TRUE;
  }
  return FALSE;
}