public function compileFile($fname, $outFname = null)
{
if (!is_readable($fname)) {
throw new Exception('load error: failed to find ' . $fname);
}
$pi = pathinfo($fname);
$oldImport = $this->importDir;
$this->importDir = (array) $this->importDir;
$this->importDir[] = $pi['dirname'] . '/';
$this->addParsedFile($fname);
$out = $this->compile($GLOBALS['wp_filesystem']->get_contents($fname), $fname);
$this->importDir = $oldImport;
if ($outFname !== null) {
return $GLOBALS['wp_filesystem']->put_contents($outFname, $out);
}
return $out;
}