Development

/branches/1.0/lib/config/sfSecurityConfigHandler.class.php

You must first sign up to be able to contribute.

root/branches/1.0/lib/config/sfSecurityConfigHandler.class.php

Revision 3624, 1.8 kB (checked in by fabien, 7 years ago)

fixed security.yml case sensitivity

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Rev Date
Line 
1 <?php
2
3 /*
4  * This file is part of the symfony package.
5  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 /**
12  * sfSecurityConfigHandler allows you to configure action security.
13  *
14  * @package    symfony
15  * @subpackage config
16  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
17  * @version    SVN: $Id$
18  */
19 class sfSecurityConfigHandler extends sfYamlConfigHandler
20 {
21   /**
22    * Executes this configuration handler.
23    *
24    * @param array An array of absolute filesystem path to a configuration file
25    *
26    * @return string Data to be written to a cache file
27    *
28    * @throws <b>sfConfigurationException</b> If a requested configuration file does not exist or is not readable
29    * @throws <b>sfParseException</b> If a requested configuration file is improperly formatted
30    * @throws <b>sfInitializationException</b> If a view.yml key check fails
31    */
32   public function execute($configFiles)
33   {
34     // parse the yaml
35     $myConfig = $this->parseYamls($configFiles);
36
37     $myConfig['all'] = sfToolkit::arrayDeepMerge(
38       isset($myConfig['default']) && is_array($myConfig['default']) ? $myConfig['default'] : array(),
39       isset($myConfig['all']) && is_array($myConfig['all']) ? $myConfig['all'] : array()
40     );
41
42     unset($myConfig['default']);
43
44     // change all of the keys to lowercase
45     $myConfig = array_change_key_case($myConfig);
46
47     // compile data
48     $retval = sprintf("<?php\n".
49                       "// auto-generated by sfSecurityConfigHandler\n".
50                       "// date: %s\n\$this->security = %s;\n",
51                       date('Y/m/d H:i:s'), var_export($myConfig, true));
52
53     return $retval;
54   }
55 }
56
Note: See TracBrowser for help on using the browser.