Skip to content

Commit

Permalink
Revert "Use Horde_Stream_Temp"
Browse files Browse the repository at this point in the history
This reverts commit 693c430.
  • Loading branch information
mrubinsk committed Oct 1, 2013
1 parent 24a1caa commit 1b6987f
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions framework/ActiveSync/lib/Horde/ActiveSync/Wbxml/Decoder.php
Expand Up @@ -79,8 +79,8 @@ public function readWbxmlHeader()
$this->_readVersion();
if ($this->version != self::WBXML_VERSION) {
// Not Wbxml - save the byte we already read.
$this->_getTempStream();
$this->_buffer->add(chr($this->version));
$this->_buffer = fopen('php://temp/maxmemory:2097152', 'r+');
fwrite($this->_buffer, chr($this->version));
$this->_isWbxml = false;
return;
} else {
Expand Down Expand Up @@ -120,9 +120,14 @@ public function isWbxml()
public function getFullInputStream()
{
// Ensure the buffer was created
$this->_getTempStream();
$this->_buffer->add($this->_stream);
$this->_buffer->rewind();
if (!isset($this->_buffer)) {
$this->_buffer = fopen('php://temp/maxmemory:2097152', 'r+');
}
while (!feof($this->_stream)) {
fwrite($this->_buffer, fread($this->_stream, 8192));
}
rewind($this->_buffer);

return $this->_buffer;
}

Expand Down Expand Up @@ -708,18 +713,4 @@ private function _getMapping($cp, $id)
}
}

/**
* Return the temporary buffer stream.
*
* @return stream
*/
protected function _getTempStream()
{
if (!isset($this->_buffer)) {
$this->_buffer = new Horde_Stream_Temp();
}

return $this->_buffer;
}

}
}

0 comments on commit 1b6987f

Please sign in to comment.