yaml-mini.php 348 B

1234567891011121314151617181920212223
  1. <?php
  2. if (!defined('_ECRIRE_INC_VERSION')) return;
  3. # yaml_decode
  4. function yaml_decode($input) {
  5. require_once dirname(__FILE__).'/../lib/yaml/sfYaml.php';
  6. require_once dirname(__FILE__).'/../lib/yaml/sfYamlParser.php';
  7. $yaml = new sfYamlParser();
  8. try
  9. {
  10. return $yaml->parse($input);
  11. }
  12. catch (Exception $e)
  13. {
  14. return null;
  15. }
  16. }
  17. ?>