Same name in other branches
  1. 6.0.x src/Asset/AssetOptimizer.php \Drupal\advagg\Asset\AssetOptimizer::shouldGZip()
  2. 8.x-3.x src/Asset/AssetOptimizer.php \Drupal\advagg\Asset\AssetOptimizer::shouldGZip()
  3. 8.x-4.x src/Asset/AssetOptimizer.php \Drupal\advagg\Asset\AssetOptimizer::shouldGZip()

Determine if settings and available PHP modules allow GZipping assets.

Return value

bool True if asset type can/should be gzipped.

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

Fichier

src/Asset/AssetOptimizer.php, line 317

Classe

AssetOptimizer
Defines the base AdvAgg optimizer.

Namespace

Drupal\advagg\Asset

Code

protected function shouldGZip() {
    if (extension_loaded('zlib') && \Drupal::config('system.performance')->get($this->extension . '.gzip')) {
        return TRUE;
    }
    return FALSE;
}