engine.less_js.inc in Less CSS Preprocessor 7.4
File
engines/engine.less_js.inc
View source
<?php
class LessEngineLess_js extends LessEngine {
private $less_js_parser;
public function __construct($input_file_path) {
parent::__construct($input_file_path);
$this->less_js_parser = Lessjs::create($this->input_file_path);
}
public function getDependencies() {
$this->dependencies = $this->less_js_parser
->depends();
return parent::getDependencies();
}
public function compile() {
$compiled_styles = NULL;
try {
$this->less_js_parser
->source_maps($this->source_maps_enabled, $this->source_maps_base_path, $this->source_maps_root_path);
foreach ($this->import_directories as $directory) {
$this->less_js_parser
->include_path($directory);
}
foreach ($this->variables as $var_name => $var_value) {
$this->less_js_parser
->modify_var(trim($var_name, '@'), trim($var_value, ';'));
}
$compiled_styles = $this->less_js_parser
->compile();
} catch (Exception $e) {
throw $e;
}
return $compiled_styles;
}
}