Skip to content

Commit

Permalink
More places to use Horde_Stream
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Sep 29, 2013
1 parent 1ed8294 commit def19d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Expand Up @@ -68,17 +68,11 @@ public function handle()
$params = array();
}
$results = $this->_driver->autoDiscover($params);

if (empty($results['raw_xml'])) {
fwrite(
$this->_encoder->getStream(),
$this->_buildResponseString($results));
$this->_encoder->getStream()->add($this->_buildResponseString($results));
} else {
// The backend is taking control of the XML.
fwrite(
$this->_encoder->getStream(),
$results['raw_xml']
);
$this->_encoder->getStream()->add($results['raw_xml']);
}

return 'text/xml';
Expand Down
Expand Up @@ -67,13 +67,10 @@ protected function _handle()
if (is_resource($att['data'])) {
$this->_logger->info('Copying attachment data directly from stream to stream.');
rewind($att['data']);
while (!feof($att['data'])) {
fwrite($this->_encoder->getStream(), fread($att['data'], 8192));
}
} else {
$this->_logger->info('Writing attachment data from string to stream.');
fwrite($this->_encoder->getStream(), $att['data']);
}
$this->_encoder->getStream()->add($att['data']);

// Indicate the content-type
// @TODO This is for BC only. Can remove for H6.
Expand Down

0 comments on commit def19d4

Please sign in to comment.