Skip to content

Commit

Permalink
Import once. Fixes issue leafo#396
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsAD committed Jun 2, 2013
1 parent ff86f29 commit 0a103e7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lessc.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class lessc {
static protected $TRUE = array("keyword", "true");
static protected $FALSE = array("keyword", "false");

protected $allParsedFiles = array();
protected $libFunctions = array();
protected $registeredVars = array();
protected $preserveComments = false;
Expand Down Expand Up @@ -108,6 +109,11 @@ protected function tryImport($importPath, $parentBlock, $out) {
if ($this->importDisabled) {
return array(false, "/* import disabled */");
}

// import once
if(array_key_exists(realpath($realPath), $this->allParsedFiles())) {
return array(false, '');
}

$this->addParsedFile($realPath);
$parser = $this->makeParser($realPath);
Expand Down

0 comments on commit 0a103e7

Please sign in to comment.