Development

/branches/1.0/lib/filter/sfSecurityFilter.class.php

You must first sign up to be able to contribute.

root/branches/1.0/lib/filter/sfSecurityFilter.class.php

Revision 7791, 1.2 kB (checked in by fabien, 7 years ago)

updated Sean Kerr email address

  • 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  * (c) 2004-2006 Sean Kerr <sean@code-box.org>
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 <sean@code-box.org>
19  * @version    SVN: $Id$
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 }
47
Note: See TracBrowser for help on using the browser.