Same name in other branches
  1. 6.0.x advagg_ext_minify/src/Asset/Minifier.php \Drupal\advagg_ext_minify\Asset\Minifier::__construct()
  2. 8.x-3.x advagg_ext_minify/src/Asset/Minifier.php \Drupal\advagg_ext_minify\Asset\Minifier::__construct()
  3. 8.x-4.x advagg_ext_minify/src/Asset/Minifier.php \Drupal\advagg_ext_minify\Asset\Minifier::__construct()

Construct the optimizer instance.

Paramètres

string $root: Gets the app root.

\Psr\Log\LoggerInterface $logger: The logger service.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: A config factory for retrieving required config objects.

\Drupal\Core\File\FileSystemInterface $file: The filesystem service.

Overrides SingleAssetOptimizerBase::__construct

Fichier

advagg_ext_minify/src/Asset/Minifier.php, line 55

Classe

Minifier
Optimizes a asset via external minifiers.

Namespace

Drupal\advagg_ext_minify\Asset

Code

public function __construct(string $root, LoggerInterface $logger, ConfigFactoryInterface $config_factory, FileSystemInterface $file) {
    parent::__construct($logger);
    $this->config = $config_factory->get('advagg_ext_minify.settings');
    $this->file = $file;
    $this->in = $file->realpath($file->tempnam('public://js/optimized', 'advagg_in'));
    $this->out = $file->realpath($file->tempnam('public://js/optimized', 'advagg_out'));
    $this->root = $root;
}