1. sfSimpleYamlConfigHandler.class.php
  2. /** * sfSimpleYamlConfigHandler allows you to load simple configuration files formatted as YAML. * * @package symfony * @subpackage config * @author Fabien Potencier * @version SVN: $Id: sfSimpleYamlConfigHandler.class.php 9085 2008-05-20 01:53:23Z Carl.Vondrick $ */
  3. class sfSimpleYamlConfigHandler extends sfYamlConfigHandler
  4. {
  5. /**
  6. * Executes this configuration handler.
  7. *
  8. * @param array $configFiles An array of absolute filesystem path to a configuration file
  9. *
  10. * @return string Data to be written to a cache file
  11. */
  12. public function execute($configFiles)
  13. {
  14. $config = self::getConfiguration($configFiles);
  15. // compile data
  16. $retval = "<?php\n".
  17. "// auto-generated by %s\n".
  18. "// date: %s\nreturn %s;\n";
  19. $retval = sprintf($retval, __CLASS__, date('Y/m/d H:i:s'), var_export($config, true));
  20. return $retval;
  21. }
  22. /**
  23. * @see sfConfigHandler
  24. */
  25. static public function getConfiguration(array $configFiles)
  26. {
  27. return self::parseYamls($configFiles);
  28. }
  29. }

Debug toolbar