Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actually no need for Horde_Stream at all.
- Loading branch information
Showing
2 changed files
with
3 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -801,9 +801,9 @@ protected function _ensureSeekable($stream) | |
|
||
$meta = stream_get_meta_data($stream); | ||
if (!$meta['seekable']) { | ||
$temp = new Horde_Stream_Temp(); | ||
$temp->add($stream, true); | ||
return $temp->stream; | ||
$temp = @fopen('php://temp', 'r+'); | ||
stream_copy_to_stream($stream, $temp); | ||
return $temp; | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
yunosh
Author
Member
|
||
|
||
rewind($stream); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I tend to use Horde_Stream when doing operations like this since it explicitly doesn't use stream_copy_to_stream, but copies the stream in smaller chunks, and quite frankly it's easier to reuse that code instead of copying it.
From what I understand stream_copy_to_stream has (or at least had) some memory/performance issues?