本文整理汇总了PHP中XmlWriter::openUri方法的典型用法代码示例。如果您正苦于以下问题:PHP XmlWriter::openUri方法的具体用法?PHP XmlWriter::openUri怎么用?PHP XmlWriter::openUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlWriter
的用法示例。
在下文中一共展示了XmlWriter::openUri方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
private function initialize()
{
if ($this->streamUri !== null) {
$this->cursor->openUri($this->streamUri);
} else {
$this->cursor->openMemory();
}
$this->cursor->startDocument($this->marshaller->getSchemaVersion(), $this->marshaller->getEncoding());
if ($this->marshaller->getIndent() > 0) {
$this->cursor->setIndent((int) $this->marshaller->getIndent());
}
}
示例2: init
protected function init()
{
if (!$this->inited) {
if (!$this->outputFilepath) {
throw new \Exception('outputFilepath option is not valid');
}
$writer = new \XmlWriter();
$writer->openUri('file://' . rawurlencode($this->outputFilepath));
$writer->setIndent(true);
$writer->startDocument('1.0', 'utf-8');
$writer->startElement('SERVER');
$this->xmlWriter = $writer;
$this->inited = true;
}
}