-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
Description
It would be great to have a function to extract files to a stream instead of a directory. At the moment, I'm calling openFromStream to read my zip archive and then calling extractTo to extract all the files to a temporary directory. Next, I'm using a foreach-loop to iterate through the files and send them back to another stream. So writing / extracting them to the local disk is completely unnecessary since I want to read the zip archive from a stream, use a foreach loop to iterate over all entries and extract each file to a stream.
Example
$zipfile = new \PhpZip\ZipFile();
$zipfile->openFromStream($myRemoteStream);
foreach ($zipfile as $entryName) {
$stream = openStream();
// Extract the content of $entryName to the given stream...
$zipfile->extractTo($stream, $entryName);
close($stream);
}
$zipfile->close();Metadata
Metadata
Assignees
Labels
No labels