本文整理汇总了PHP中_generateP3PHeader函数的典型用法代码示例。如果您正苦于以下问题:PHP _generateP3PHeader函数的具体用法?PHP _generateP3PHeader怎么用?PHP _generateP3PHeader使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_generateP3PHeader函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MAX_cookieSendP3PHeaders
function MAX_cookieSendP3PHeaders()
{
if ($GLOBALS['_MAX']['CONF']['p3p']['policies']) {
MAX_header("P3P: " . _generateP3PHeader());
}
}
示例2: test_generateP3PHeader
/**
* Test that the P3P string to be put into the P3P header is generated correctly
*
*/
function test_generateP3PHeader()
{
$conf =& $GLOBALS['_MAX']['CONF'];
// Test that nothing is generated if $conf['p3p']['policies'] is false
$conf['p3p']['policies'] = false;
$this->assertEqual(_generateP3PHeader(), '');
// Test that the compact policy header is generated correctly with a compact policy
// and a policyLocation
$conf['p3p']['policies'] = true;
$conf['p3p']['compactPolicy'] = 'CUR ADM OUR NOR STA NID';
$conf['p3p']['policyLocation'] = 'http://www.openx.org/policy.xml';
$this->assertEqual(_generateP3PHeader(), ' policyref="' . $conf['p3p']['policyLocation'] . '", CP="' . $conf['p3p']['compactPolicy'] . '"');
// Test that the compact policy header is generated correctly with just a compact policy
$conf['p3p']['policies'] = true;
$conf['p3p']['compactPolicy'] = 'CUR ADM OUR NOR STA NID';
$conf['p3p']['policyLocation'] = '';
$this->assertEqual(_generateP3PHeader(), ' CP="' . $conf['p3p']['compactPolicy'] . '"');
// Test that the compact policy header is generated correctly with just a policy location
$conf['p3p']['policies'] = true;
$conf['p3p']['compactPolicy'] = '';
$conf['p3p']['policyLocation'] = 'http://www.openx.org/policy.xml';
$this->assertEqual(_generateP3PHeader(), ' policyref="' . $conf['p3p']['policyLocation'] . '"');
// Test that the compact policy header is not generated without either policy location or compact policy
$conf['p3p']['policies'] = true;
$conf['p3p']['compactPolicy'] = '';
$conf['p3p']['policyLocation'] = '';
$this->assertEqual(_generateP3PHeader(), '');
}