1. sfSecurityConfigHandler.class.php
  2. /** * sfSecurityConfigHandler allows you to configure action security. * * @package symfony * @subpackage config * @author Fabien Potencier * @version SVN: $Id: sfSecurityConfigHandler.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ */
  3. class sfSecurityConfigHandler 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. * @throws <b>sfConfigurationException</b> If a requested configuration file does not exist or is not readable
  13. * @throws <b>sfParseException</b> If a requested configuration file is improperly formatted
  14. * @throws <b>sfInitializationException</b> If a view.yml key check fails
  15. */
  16. public function execute($configFiles)
  17. {
  18. // parse the yaml
  19. $config = self::getConfiguration($configFiles);
  20. // compile data
  21. $retval = sprintf("<?php\n".
  22. "// auto-generated by sfSecurityConfigHandler\n".
  23. "// date: %s\n\$this->security = %s;\n",
  24. date('Y/m/d H:i:s'), var_export($config, true));
  25. return $retval;
  26. }
  27. /**
  28. * @see sfConfigHandler
  29. */
  30. static public function getConfiguration(array $configFiles)
  31. {
  32. $config = self::flattenConfiguration(self::parseYamls($configFiles));
  33. // change all of the keys to lowercase
  34. $config = array_change_key_case($config);
  35. return $config;
  36. }
  37. }

Debug toolbar