Example #1
0
 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());
     }
 }
Example #2
0
 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;
     }
 }