Source for file Policy.php
Documentation is available at Policy.php
* represents the security settings of a dwoo instance, it can be passed around to different dwoo instances
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
* @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://dwoo.org/LICENSE Modified BSD License
* php handling constants, defaults to PHP_REMOVE
* PHP_REMOVE : remove all <?php ?> (+ short tags if your short tags option is on) from the input template
* PHP_ALLOW : leave them as they are
* PHP_ENCODE : run htmlentities over them
* constant handling constants, defaults to CONST_DISALLOW
* CONST_DISALLOW : throw an error if {$dwoo.const.*} is used in the template
* CONST_ALLOW : allow {$dwoo.const.*} calls
const CONST_DISALLOW =
false;
const CONST_ALLOW =
true;
* php functions that are allowed to be used within the template
'str_repeat', 'number_format', 'htmlentities', 'htmlspecialchars',
'long2ip', 'strlen', 'list', 'empty', 'count', 'sizeof', 'in_array', 'is_array',
* paths that are safe to use with include or other file-access plugins
* stores the php handling level
* defaults to Dwoo_Security_Policy::PHP_REMOVE
* stores the constant handling level
* defaults to Dwoo_Security_Policy::CONST_DISALLOW
* adds a php function to the allowed list
* @param mixed $func function name or array of function names
foreach ($func as $fname)
* removes a php function from the allowed list
* @param mixed $func function name or array of function names
foreach ($func as $fname)
* returns the list of php functions allowed to run, note that the function names
* are stored in the array keys and not values
* adds a directory to the safelist for includes and other file-access plugins
* note that all the includePath directories you provide to the Dwoo_Template_File class
* are automatically marked as safe
* @param mixed $path a path name or an array of paths
* removes a directory from the safelist
* @param mixed $path a path name or an array of paths
* returns the list of safe paths, note that the paths are stored in the array
* sets the php handling level, defaults to REMOVE
* @param int $level one of the Dwoo_Security_Policy::PHP_* constants
* returns the php handling level
* @return int the current level, one of the Dwoo_Security_Policy::PHP_* constants
* sets the constant handling level, defaults to CONST_DISALLOW
* @param bool $level one of the Dwoo_Security_Policy::CONST_* constants
* returns the constant handling level
* @return bool the current level, one of the Dwoo_Security_Policy::CONST_* constants
Documentation generated on Sun, 07 Feb 2010 17:53:54 +0000 by phpDocumentor 1.4.0