本文整理匯總了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;
}
}