Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2701,6 +2701,18 @@ public function unsetVariable($name)
unset($this->registeredVars[$name]);
}

/**
* Returns list of variables
*
* @api
*
* @return array
*/
public function getVariables()
{
return $this->registeredVars;
}

/**
* Adds to list of parsed files
*
Expand Down
6 changes: 6 additions & 0 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ protected function needsCompile($in, $out, &$etag)
return true;
}
}

$metaVars = crc32(serialize($this->scss->getVariables()));
if ($metaVars!=$metadata['vars']) {
return true;
}

$etag = $metadata['etag'];

Expand Down Expand Up @@ -213,6 +218,7 @@ protected function compile($in, $out)
serialize(array(
'etag' => $etag,
'imports' => $this->scss->getParsedFiles(),
'vars' => crc32(serialize($this->scss->getVariables())),
))
);

Expand Down