Same name and namespace in other branches
  1. 5.0.x src/Asset/SingleAssetOptimizerBase.php \Drupal\advagg\Asset\SingleAssetOptimizerBase::addLicense() 1 commentaire
  2. 6.0.x src/Asset/SingleAssetOptimizerBase.php \Drupal\advagg\Asset\SingleAssetOptimizerBase::addLicense() 1 commentaire
  3. 8.x-4.x src/Asset/SingleAssetOptimizerBase.php \Drupal\advagg\Asset\SingleAssetOptimizerBase::addLicense() 1 commentaire

If configured, add licence string to top/bottom of file.

Paramètres

string $contents: The file contents.

string $path: The original file path.

1 call to SingleAssetOptimizerBase::addLicense()
CssMinifier::loadFile dans advagg_css_minify/src/Asset/CssMinifier.php
Loads the stylesheet and resolves all @import commands.

Fichier

src/Asset/SingleAssetOptimizerBase.php, line 59

Classe

SingleAssetOptimizerBase
A base class for optimizing (especially minifying) assets.

Namespace

Drupal\advagg\Asset

Code

public function addLicense(&$contents, $path) {
    if ($this->config
        ->get('add_license')) {
        $url = file_create_url($path);
        $contents = "/* Source and licensing information for the line(s) below can be found at {$url}. */\n" . $contents . "\n/* Source and licensing information for the above line(s) can be found at {$url}. */";
    }
}