* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * sfSecurityConfigHandler allows you to configure action security. * * @package symfony * @subpackage config * @author Fabien Potencier * @version SVN: $Id: sfSecurityConfigHandler.class.php 3624 2007-03-17 10:57:03Z fabien $ */ class sfSecurityConfigHandler extends sfYamlConfigHandler { /** * Executes this configuration handler. * * @param array An array of absolute filesystem path to a configuration file * * @return string Data to be written to a cache file * * @throws sfConfigurationException If a requested configuration file does not exist or is not readable * @throws sfParseException If a requested configuration file is improperly formatted * @throws sfInitializationException If a view.yml key check fails */ public function execute($configFiles) { // parse the yaml $myConfig = $this->parseYamls($configFiles); $myConfig['all'] = sfToolkit::arrayDeepMerge( isset($myConfig['default']) && is_array($myConfig['default']) ? $myConfig['default'] : array(), isset($myConfig['all']) && is_array($myConfig['all']) ? $myConfig['all'] : array() ); unset($myConfig['default']); // change all of the keys to lowercase $myConfig = array_change_key_case($myConfig); // compile data $retval = sprintf("security = %s;\n", date('Y/m/d H:i:s'), var_export($myConfig, true)); return $retval; } }