Leafo\ScssPhp\Server::compileFile PHP Method

compileFile() public method

Compile .scss file
public compileFile ( string $in, string $out = null ) : string | boolean
$in string Input file (.scss)
$out string Output file (.css) optional
return string | boolean
    public function compileFile($in, $out = null)
    {
        if (!is_readable($in)) {
            throw new ServerException('load error: failed to find ' . $in);
        }
        $pi = pathinfo($in);
        $this->scss->addImportPath($pi['dirname'] . '/');
        $compiled = $this->scss->compile(file_get_contents($in), $in);
        if ($out !== null) {
            return file_put_contents($out, $compiled);
        }
        return $compiled;
    }