Leafo\ScssPhp\Server::compile PHP Method

compile() protected method

Compile .scss file
protected compile ( string $in, string $out ) : array
$in string Input path (.scss)
$out string Output path (.css)
return array
    protected function compile($in, $out)
    {
        $start = microtime(true);
        $css = $this->scss->compile(file_get_contents($in), $in);
        $elapsed = round(microtime(true) - $start, 4);
        $v = Version::VERSION;
        $t = date('r');
        $css = "/* compiled by scssphp {$v} on {$t} ({$elapsed}s) */\n\n" . $css;
        $etag = md5($css);
        file_put_contents($out, $css);
        file_put_contents($this->metadataName($out), serialize(['etag' => $etag, 'imports' => $this->scss->getParsedFiles(), 'vars' => crc32(serialize($this->scss->getVariables()))]));
        return [$css, $etag];
    }