[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/config/ -> sfSecurityConfigHandler.class.php (source)

   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: sfSecurityConfigHandler.class.php 3203 2007-01-09 18:32:54Z fabien $
  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      // compile data
  45      $retval = sprintf("<?php\n".
  46                        "// auto-generated by sfSecurityConfigHandler\n".
  47                        "// date: %s\n\$this->security = %s;\n",
  48                        date('Y/m/d H:i:s'), var_export($myConfig, true));
  49  
  50      return $retval;
  51    }
  52  }


Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7