function unyaml($file) { static $yaml = false; if (!$yaml) { $yaml = new sfYamlParser(); } $data = $yaml->parse(file_get_contents($file)); $data = fix_comments($data); return $data; }
function unyaml($file) { static $yaml = false; if ($_SERVER['HTTP_HOST'] != 'localhost:8000') { if (cache_exists($file)) { return read_cache($file); } } if (!$yaml) { $yaml = new sfYamlParser(); } $data = $yaml->parse(file_get_contents($file)); $data = fix_comments($data); write_cache($file, $data); return $data; }