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

Minify CSS using via command line.

Parameters

string $contents: The CSS to minify.

Return value

string The processed CSS or FALSE on failure.

File

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

Class

Minifier
Optimizes a asset via external minifiers.

Namespace

Drupal\advagg_ext_minify\Asset

Code

public function css($contents) {
    file_put_contents($this->in, $contents);
    $output = $this->execute('css');
    $contents = file_get_contents($output);
    return $contents;
}