You are here

public function LessEngineLessphp::compile in Less CSS Preprocessor 7.4

Same name and namespace in other branches
  1. 8 engines/engine.lessphp.inc \LessEngineLessphp::compile()

This compiles using engine specific function calls.

Overrides LessEngineInterface::compile

File

engines/engine.lessphp.inc, line 31

Class

LessEngineLessphp
Class \LessEngineLessphp

Code

public function compile() {
  $compiled_styles = NULL;
  try {
    foreach ($this->import_directories as $directory) {
      $this->less_php_parser
        ->addImportDir($directory);
    }
    $cache = $this->less_php_parser
      ->cachedCompile($this->input_file_path);
    $this->dependencies = array_keys($cache['files']);
    $compiled_styles = $cache['compiled'];
  } catch (Exception $e) {
    throw $e;
  }
  return $compiled_styles;
}