Development

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

You must first sign up to be able to contribute.

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

Revision 9085, 1.7 kB (checked in by Carl.Vondrick, 6 years ago)

1.1: fixed @param phpdoc to fit specs in config (refs #2991)

  • 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 $configFiles 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     $config = self::getConfiguration($configFiles);
36
37     // compile data
38     $retval = sprintf("<?php\n".
39                       "// auto-generated by sfSecurityConfigHandler\n".
40                       "// date: %s\n\$this->security = %s;\n",
41                       date('Y/m/d H:i:s'), var_export($config, true));
42
43     return $retval;
44   }
45
46   /**
47    * @see sfConfigHandler
48    */
49   static public function getConfiguration(array $configFiles)
50   {
51     $config = self::flattenConfiguration(self::parseYamls($configFiles));
52
53     // change all of the keys to lowercase
54     $config = array_change_key_case($config);
55
56     return $config;
57   }
58 }
59
Note: See TracBrowser for help on using the browser.