Proxy to run Compression on the sheet passed. Handle options here.

Paramètres

(string) css: Stylesheet to be compressed:

(mixed) options: Array of options or mode to use.:

Fichier

advagg_css_compress/css-compressor-3.x/src/lib/Control.inc, line 184

Classe

CSSCompression_Control
CSS Compressor [VERSION] [DATE] Corey Hart @ <a href="http://www.codenothing.com">http://www.codenothing.com</a>

Code

public function compress($css = NULL, $options = NULL) {
    // Flush out old stats and variables
    $this->flush();
    // If no additional options, just run compression
    if ($options === NULL) {
        return $this->css = $this->Compress
            ->compress($css);
    }
    // Store old params
    $old = $this->mode == '__custom' ? $this->Option
        ->option() : $this->mode;
    $readability = $this->Option
        ->option('readability');
    // Compress with new set of options
    $this->Option
        ->merge($options);
    $css = $this->Compress
        ->compress($css);
    // Reset original options
    $this->reset();
    $this->Option
        ->merge($old);
    // Return the compressed css
    return $this->css = $css;
}