Skip to content

frizinak/ZipStreamer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Usage

$output = new ThrottledHttp('download', 1024 * 1024 * 3); // Stream ~3 MB/s
$zip = new ZipStreamer($output);
foreach($images as $filePath){
  $zip->add('images/' . basename($filePath), $filePath); // No deflation
  $zip->send(); // starts reading from $filePath and streaming the zip.
}

foreach($httpTextFiles as $fileUri) {
  $zip->add('txts/' . basename($fileUri), $fileUri, 9); // Max deflation level.
}

$fh = fopen('http://www.google.com', 'rb');
$zip->add('google.html', $fh, -1); // Default zlib delfation level.

$zip->flush(); // Sends any remaining files and finishes streaming the zip.

License: MIT

About

PHP zip implementation to stream zips while appending files. Based on http://hg.pablotron.org/zipstream-php

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages