Same name in other branches
  1. 5.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.

Parameters

string $root: Gets the app root.

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

\Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator: The file URL generator.

\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

File

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

Class

Minifier
Optimizes a asset via external minifiers.

Namespace

Drupal\advagg_ext_minify\Asset

Code

public function __construct(string $root, LoggerInterface $logger, FileUrlGeneratorInterface $file_url_generator, ConfigFactoryInterface $config_factory, FileSystemInterface $file) {
    parent::__construct($logger, $file_url_generator);
    $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;
    $this->fileUrlGenerator = $file_url_generator;
}