Changeset View
Changeset View
Standalone View
Standalone View
lib/ext/Syncroton/Wbxml/Encoder.php
Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | class Syncroton_Wbxml_Encoder extends Syncroton_Wbxml_Abstract | ||||
* | * | ||||
* @param string $_xml the xml string | * @param string $_xml the xml string | ||||
* @return resource stream | * @return resource stream | ||||
*/ | */ | ||||
public function encode(DOMDocument $_dom) | public function encode(DOMDocument $_dom) | ||||
{ | { | ||||
$_dom->formatOutput = false; | $_dom->formatOutput = false; | ||||
$tempStream = fopen('php://temp/maxmemory:5242880', 'r+'); | $tempStream = tmpfile(); | ||||
fwrite($tempStream, $_dom->saveXML()); | |||||
$meta_data = stream_get_meta_data($tempStream); | |||||
$filename = $meta_data["uri"]; | |||||
$_dom->save($filename); | |||||
rewind($tempStream); | rewind($tempStream); | ||||
$this->_initialize($_dom); | $this->_initialize($_dom); | ||||
$parser = xml_parser_create_ns($this->_charSet, ';'); | $parser = xml_parser_create_ns($this->_charSet, ';'); | ||||
xml_set_object($parser, $this); | xml_set_object($parser, $this); | ||||
xml_set_element_handler($parser, '_handleStartTag', '_handleEndTag'); | xml_set_element_handler($parser, '_handleStartTag', '_handleEndTag'); | ||||
xml_set_character_data_handler($parser, '_handleCharacters'); | xml_set_character_data_handler($parser, '_handleCharacters'); | ||||
▲ Show 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | protected function _switchCodePage($_nameSpace) | ||||
$this->_nextStackPop = $this->_level; | $this->_nextStackPop = $this->_level; | ||||
$this->_stream = fopen("php://temp", 'r+'); | $this->_stream = fopen("php://temp", 'r+'); | ||||
$this->_initialize($_urn); | $this->_initialize($_urn); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |