2 if (!defined("_ECRIRE_INC_VERSION")) return;
4 function yaml_sfyaml_encode($struct, $opt = array()) {
5 require_once _DIR_PLUGIN_YAML
.'sfyaml/sfYaml.php';
6 require_once _DIR_PLUGIN_YAML
.'sfyaml/sfYamlDumper.php';
11 $yaml = new sfYamlDumper();
12 return $yaml->dump($struct, $opt['inline']);
15 function yaml_sfyaml_decode($input,$show_error=true) {
16 require_once _DIR_PLUGIN_YAML
.'sfyaml/sfYaml.php';
17 require_once _DIR_PLUGIN_YAML
.'sfyaml/sfYamlParser.php';
19 $yaml = new sfYamlParser();
23 $ret = $yaml->parse($input);
28 throw new InvalidArgumentException(sprintf('Unable to parse string: %s', $e->getMessage()));