final function compile_file($file, $safe = FALSE, $context = array())
{
if (!is_readable($file)) {
throw new Haanga_Compiler_Exception("{$file} is not a file");
}
$this->_base_dir = dirname($file);
$this->file = realpath($file);
$this->line = 0;
$this->check_function = $safe;
$this->context = $context;
$name = $this->set_template_name($file);
try {
return $this->compile(file_get_contents($file), $name, $file);
} catch (Exception $e) {
$this->Error((string) $e);
}
}