Esempio n. 1
0
function unyaml($file)
{
    static $yaml = false;
    if (!$yaml) {
        $yaml = new sfYamlParser();
    }
    $data = $yaml->parse(file_get_contents($file));
    $data = fix_comments($data);
    return $data;
}
Esempio n. 2
0
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;
}