[ Index ]
 

Code source de Symfony 1.0.0

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

title

Body

[fermer]

/lib/filter/ -> sfSecurityFilter.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   * (c) 2004-2006 Sean Kerr.
   7   * 
   8   * For the full copyright and license information, please view the LICENSE
   9   * file that was distributed with this source code.
  10   */
  11  
  12  /**
  13   * sfSecurityFilter provides a base class that classifies a filter as one that handles security.
  14   *
  15   * @package    symfony
  16   * @subpackage filter
  17   * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
  18   * @author     Sean Kerr <skerr@mojavi.org>
  19   * @version    SVN: $Id: sfSecurityFilter.class.php 3244 2007-01-12 14:46:11Z fabien $
  20   */
  21  abstract class sfSecurityFilter extends sfFilter
  22  {
  23    /**
  24     * Returns a new instance of a sfSecurityFilter.
  25     *
  26     * @param string The security class name
  27     *
  28     * @return sfSecurityFilter A sfSecurityFilter implementation instance
  29     */
  30    public static function newInstance($class)
  31    {
  32      // the class exists
  33      $object = new $class();
  34  
  35      if (!($object instanceof sfSecurityFilter))
  36      {
  37        // the class name is of the wrong type
  38        $error = 'Class "%s" is not of the type sfSecurityFilter';
  39        $error = sprintf($error, $class);
  40  
  41        throw new sfFactoryException($error);
  42      }
  43  
  44      return $object;
  45    }
  46  }


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