本文整理汇总了PHP中XmlManager::createLocalFileInputStream方法的典型用法代码示例。如果您正苦于以下问题:PHP XmlManager::createLocalFileInputStream方法的具体用法?PHP XmlManager::createLocalFileInputStream怎么用?PHP XmlManager::createLocalFileInputStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlManager
的用法示例。
在下文中一共展示了XmlManager::createLocalFileInputStream方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: XmlManager
Displays the behavior of XmlInputStream. When a is stream is created it can
only be destroyed by passing it to putDocument. Also, once it is passed
to putDocument, if it is accessed again it will cause a segment fault
EXPECTED RESULT:
book1.xml = <book><title>Knowledge Discovery in Databases.</title></book>
ACTUAL RESULT:
<?php
$file_name = "book1.xml";
$mgr = new XmlManager();
if ($mgr->existsContainer("test.dbxml")) {
$mgr->removeContainer("test.dbxml");
}
$con = $mgr->createContainer("test.dbxml");
$inputstream = $mgr->createLocalFileInputStream($file_name);
$con->putDocument($file_name, $inputstream);
$doc = $con->getDocument($file_name);
$s = $doc->getContentAsString();
print $doc->getName() . " = {$s}\n";
unset($doc);
unset($con);
$mgr->removeContainer("test.dbxml");