本文整理汇总了PHP中Dwoo::setSecurityPolicy方法的典型用法代码示例。如果您正苦于以下问题:PHP Dwoo::setSecurityPolicy方法的具体用法?PHP Dwoo::setSecurityPolicy怎么用?PHP Dwoo::setSecurityPolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dwoo
的用法示例。
在下文中一共展示了Dwoo::setSecurityPolicy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetSetSecurityPolicy
public function testGetSetSecurityPolicy()
{
$dwoo = new Dwoo(DWOO_COMPILE_DIR, DWOO_CACHE_DIR);
$policy = new Dwoo_Security_Policy();
$policy->setConstantHandling(Dwoo_Security_Policy::CONST_ALLOW);
$dwoo->setSecurityPolicy($policy);
$this->assertEquals($policy, $dwoo->getSecurityPolicy());
$this->assertEquals($policy->getConstantHandling(), $dwoo->getSecurityPolicy()->getConstantHandling());
}
示例2: spawn
function spawn()
{
// Main Dwoo object
$dwoo = new Dwoo();
// The directory where compiled templates are located
$dwoo->setCompileDir($this->_parser_compile_dir);
$dwoo->setCacheDir($this->_parser_cache_dir);
$dwoo->setCacheTime($this->_parser_cache_time);
// Security
$security = new MY_Security_Policy();
$security->setPhpHandling($this->_parser_allow_php_tags);
$security->allowPhpFunction($this->_parser_allowed_php_functions);
$dwoo->setSecurityPolicy($security);
return $dwoo;
}
示例3: spawn
/**
* Spawns a new instance of Dwoo.
*
* @return object
**/
protected function spawn()
{
if (is_writable($this->compile_dir)) {
// Main Dwoo object
$dwoo = new Dwoo();
// Set the directory of where to compile the files
$dwoo->setCompileDir($this->compile_dir);
// set security policy
$security = new MY_Security_Policy();
// no PHP handline
$security->setPhpHandling(1);
$security->allowPhpFunction($this->allowed_functions);
$dwoo->setSecurityPolicy($security);
return $dwoo;
}
}
示例4: spawn
function spawn()
{
// try to create directory if it doesn't exist'
// added by David McReynolds @ Daylight Studio 9/16/10 to prevent problems of axing the entire directory
if (!is_dir($this->_parser_compile_dir)) {
@mkdir($this->_parser_compile_dir, 0777, TRUE);
chmodr($this->_parser_compile_dir, 0777);
}
if (is_writable($this->_parser_compile_dir)) {
// Main Dwoo object
$dwoo = new Dwoo();
// The directory where compiled templates are located
$dwoo->setCompileDir($this->_parser_compile_dir);
$dwoo->setCacheDir($this->_parser_cache_dir);
$dwoo->setCacheTime($this->_parser_cache_time);
// Security
$security = new MY_Security_Policy();
$security->setPhpHandling($this->_parser_allow_php_tags);
$security->allowPhpFunction($this->_parser_allowed_php_functions);
$dwoo->setSecurityPolicy($security);
return $dwoo;
}
}