public function SassCompiler::compile in Sassy 7
1 call to SassCompiler::compile()
- SassCompiler::loop in phamlp/
sassc.php
File
- phamlp/
sassc.php, line 66
Class
Code
public function compile() {
try {
clearstatcache();
foreach ($this
->getFiles() as $i => $file) {
$fname = $file['filename'];
if (!isset($this->_updates[$fname]) || filemtime($file['filename']) > $this->_updates[$fname]) {
$c = file_get_contents($file['filename']);
if (empty($c)) {
continue;
}
$result = $this->_sass
->toCss($c, false);
$newfile = substr($fname, 0, -5) . '.css';
file_put_contents($newfile, $result);
$this->_updates[$fname] = filemtime($file['filename']);
echo "save file {$newfile}\n";
}
}
} catch (Exception $e) {
$result = $e
->getMessage();
echo "Error: " . $result;
}
}