Same name in other branches
- 5.0.x src/Asset/AssetOptimizer.php \Drupal\advagg\Asset\AssetOptimizer::__construct()
- 6.0.x src/Asset/AssetOptimizer.php \Drupal\advagg\Asset\AssetOptimizer::__construct()
- 8.x-4.x src/Asset/AssetOptimizer.php \Drupal\advagg\Asset\AssetOptimizer::__construct()
Constructs the Optimizer object.
Paramètres
\Drupal\Core\Config\ConfigFactoryInterface $config_factory: A config factory for retrieving required config objects.
\Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher $event_dispatcher: The event dispatcher.
\Drupal\Core\Cache\CacheBackendInterface $cache: The AdvAgg cache.
2 methods override AssetOptimizer::__construct()
- CssOptimizer::__construct dans src/
Asset/ CssOptimizer.php - Constructs the Optimizer object.
- JsOptimizer::__construct dans src/
Asset/ JsOptimizer.php - Constructs the Optimizer object.
Fichier
-
src/
Asset/ AssetOptimizer.php, line 103
Classe
- AssetOptimizer
- Defines the base AdvAgg optimizer.
Namespace
Drupal\advagg\AssetCode
public function __construct(ConfigFactoryInterface $config_factory, ContainerAwareEventDispatcher $event_dispatcher, CacheBackendInterface $cache) {
$this->config = $config_factory->get('advagg.settings');
$this->eventDispatcher = $event_dispatcher;
$this->cache = $cache;
$this->dnsPrefetch = [];
$this->cacheLevel = $this->config
->get('cache_level');
$this->fixType = $this->config
->get("{$this->extension}.fix_type");
if ($this->fixType) {
$this->basePath = substr($GLOBALS['base_root'] . $GLOBALS['base_path'], strpos($GLOBALS['base_root'] . $GLOBALS['base_path'], '//') + 2);
$this->basePathLen = strlen($this->basePath);
}
$this->gZip = $this->shouldGZip();
$this->brotli = $this->shouldBrotli();
}