Same name and namespace in other branches
  1. 5.0.x advagg_ext_minify/src/Asset/Minifier.php \Drupal\advagg_ext_minify\Asset\Minifier::execute() 1 commentaire
  2. 6.0.x advagg_ext_minify/src/Asset/Minifier.php \Drupal\advagg_ext_minify\Asset\Minifier::execute() 1 commentaire
  3. 8.x-3.x advagg_ext_minify/src/Asset/Minifier.php \Drupal\advagg_ext_minify\Asset\Minifier::execute() 1 commentaire

Run the command line.

Paramètres

string $ext: The string css or js.

Return value

string The file containing the minified data.

2 calls to Minifier::execute()
Minifier::css dans advagg_ext_minify/src/Asset/Minifier.php
Minify CSS using via command line.
Minifier::js dans advagg_ext_minify/src/Asset/Minifier.php
Minify Javascript using via command line.

Fichier

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

Classe

Minifier
Optimizes a asset via external minifiers.

Namespace

Drupal\advagg_ext_minify\Asset

Code

protected function execute($ext) {
    $run = $this->config
        ->get($ext . '_cmd');
    $run = str_replace([
        '{%CWD%}',
        '{%IN%}',
        '{%IN_URL_ENC%}',
        '{%OUT%}',
    ], [
        $this->root,
        $this->in,
        urlencode(file_create_url($this->in)),
        escapeshellarg(realpath($this->out)),
    ], $run);
    // Run command and return the output file.
    shell_exec($run);
    return $this->out;
}