本文整理匯總了PHP中XMLReader::getParserProperty方法的典型用法代碼示例。如果您正苦於以下問題:PHP XMLReader::getParserProperty方法的具體用法?PHP XMLReader::getParserProperty怎麽用?PHP XMLReader::getParserProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XMLReader
的用法示例。
在下文中一共展示了XMLReader::getParserProperty方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testURLInvocation_doctype_setParserProperty_SUBST_ENTITIES
public function testURLInvocation_doctype_setParserProperty_SUBST_ENTITIES()
{
// reset the counter
$r = file_get_contents("http://127.0.0.1:5000/reset");
$r = file_get_contents("http://127.0.0.1:5000/getCounter");
$r = preg_replace('/\\s+/', '', $r);
$this->assertEquals("0", $r);
$xml = new XMLReader();
$xml->open("../../xml_files_windows/ssrf/url_invocation_doctype.xml");
$xml->setParserProperty(XMLReader::SUBST_ENTITIES, true);
$this->assertTrue($xml->getParserProperty(XMLReader::SUBST_ENTITIES));
while ($xml->read()) {
if ($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'data') {
$node = $xml->name;
$content = $xml->readString();
}
}
$r = file_get_contents("http://127.0.0.1:5000/getCounter");
$r = preg_replace('/\\s+/', '', $r);
$this->assertEquals("0", $r);
}
示例2: XMLReader
<?php
/* $Id$ */
$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
<books></books>';
$reader = new XMLReader();
$reader->XML($xmlstring);
$a = $reader->setParserProperty(XMLReader::LOADDTD, false);
$b = $reader->getParserProperty(XMLReader::LOADDTD);
if (!$a && !$b) {
echo "ok\n";
}
$a = $reader->setParserProperty(XMLReader::SUBST_ENTITIES, true);
$b = $reader->getParserProperty(XMLReader::SUBST_ENTITIES);
if ($a && $b) {
echo "ok\n";
}
// Only go through
while ($reader->read()) {
}
$reader->close();
?>
===DONE===
示例3: getParserProperty
public function getParserProperty($property)
{
return parent::getParserProperty($property);
}