You are here

public function ScssphpCompiler::init in SCSS/Less Compiler 8

Calls a code on plugin initialization.

Overrides ScssCompilerPluginBase::init

File

src/Plugin/ScssCompiler/ScssphpCompiler.php, line 34

Class

ScssphpCompiler
Plugin implementation of the Scss compiler.

Namespace

Drupal\scss_compiler\Plugin\ScssCompiler

Code

public function init() {
  $status = self::getStatus();
  if ($status !== TRUE) {
    throw new \Exception($status);
  }
  $this->parser = new Compiler();
  $this->parser
    ->setFormatter($this
    ->getScssPhpFormatClass($this->scssCompiler
    ->getOption('output_format')));

  // Disable utf-8 support to increase performance.
  $this->parser
    ->setEncoding(TRUE);
}