You are here

abstract class LessEngine in Less CSS Preprocessor 7.4

Same name and namespace in other branches
  1. 8 engines/abstract.LessEngine.inc \LessEngine

Class \LessEngine

Hierarchy

Expanded class hierarchy of LessEngine

File

engines/abstract.LessEngine.inc, line 6

View source
abstract class LessEngine implements LessEngineInterface {

  /**
   * Path to the input .less file.
   *
   * @var string
   */
  protected $input_file_path;

  /**
   * This will get populated with a list of files that $input_file_path depended
   * on through @import statements.
   *
   * @var string[]
   */
  protected $dependencies = array();

  /**
   * This contains any variables that are to be modified into the output.
   *
   * Key => value pairs, where the key is the LESS variable name.
   *
   * @var string[]
   */
  protected $variables = array();

  /**
   * List of directories that are to be used for @import lookups.
   *
   * @var string[]
   */
  protected $import_directories = array();

  /**
   * Flag if source maps are enabled.
   *
   * @var bool
   */
  protected $source_maps_enabled = FALSE;

  /**
   * @var string|NULL
   */
  protected $source_maps_base_path = NULL;

  /**
   * @var string|NULL
   */
  protected $source_maps_root_path = NULL;

  /**
   * Basic constructor.
   *
   * Sets input_file_path property.
   *
   * @param string $input_file_path
   */
  public function __construct($input_file_path) {
    $this->input_file_path = $input_file_path;
  }

  /**
   * {@inheritdoc}
   */
  public function setImportDirectories(array $directories) {
    $this->import_directories = $directories;
  }

  /**
   * {@inheritdoc}
   */
  public function setSourceMaps($enabled = FALSE, $base_path = NULL, $root_path = NULL) {
    $this->source_maps_enabled = $enabled;
    $this->source_maps_base_path = $base_path;
    $this->source_maps_root_path = $root_path;
  }

  /**
   * {@inheritdoc}
   */
  public function modifyVariables(array $variables) {
    $this->variables = $variables;
  }

  /**
   * {@inheritdoc}
   */
  public function getDependencies() {
    return $this->dependencies;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LessEngine::$dependencies protected property This will get populated with a list of files that $input_file_path depended on through @import statements.
LessEngine::$import_directories protected property List of directories that are to be used for @import lookups.
LessEngine::$input_file_path protected property Path to the input .less file.
LessEngine::$source_maps_base_path protected property
LessEngine::$source_maps_enabled protected property Flag if source maps are enabled.
LessEngine::$source_maps_root_path protected property
LessEngine::$variables protected property This contains any variables that are to be modified into the output.
LessEngine::getDependencies public function Returns list of dependencies. Overrides LessEngineInterface::getDependencies 1
LessEngine::modifyVariables public function Set/override variables. Overrides LessEngineInterface::modifyVariables
LessEngine::setImportDirectories public function Set list of lookup directories for @import statements. Overrides LessEngineInterface::setImportDirectories
LessEngine::setSourceMaps public function Enable Overrides LessEngineInterface::setSourceMaps
LessEngine::__construct public function Basic constructor. 3
LessEngineInterface::compile public function This returns the compiled output from the LESS engine. 3