https://github.com/jmathai/s3-bucket-stream-zip-php
PHP library to efficiently stream contents from an AWS S3 bucket or folder as a zip file.
https://github.com/jmathai/s3-bucket-stream-zip-php
Last synced: about 1 year ago
JSON representation
PHP library to efficiently stream contents from an AWS S3 bucket or folder as a zip file.
- Host: GitHub
- URL: https://github.com/jmathai/s3-bucket-stream-zip-php
- Owner: jmathai
- License: mit
- Created: 2015-03-06T06:48:15.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-07-23T17:53:50.000Z (almost 9 years ago)
- Last Synced: 2025-03-27T12:52:35.237Z (over 1 year ago)
- Language: PHP
- Size: 34.2 KB
- Stars: 56
- Watchers: 4
- Forks: 16
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# S3BucketStreamZip
[](https://travis-ci.org/jmathai/s3-bucket-stream-zip-php)
[](https://scrutinizer-ci.com/g/jmathai/s3-bucket-stream-zip-php/?branch=master)
[](https://scrutinizer-ci.com/g/jmathai/s3-bucket-stream-zip-php/?branch=master)
## Overview
This library lets you efficiently stream the contents of an S3 bucket/folder as a zip file to the client.
## Installation
Installation is done via composer by adding the a dependency on jmathai/s3-bucket-stream-zip-php.
```
composer require jmathai/s3-bucket-stream-zip-php
composer install
```
## Usage
```php
// taken from examples/simple.php
// since large buckets may take lots of time we remove any time limits
set_time_limit(0);
require sprintf('%s/../vendor/autoload.php', __DIR__);
use JMathai\S3BucketStreamZip\S3BucketStreamZip;
use JMathai\S3BucketStreamZip\Exception\InvalidParameterException;
$stream = new S3BucketStreamZip(
// $auth
array(
'key' => '*********', // required
'secret' => '*********' // required
),
// $params
array(
'Bucket' => 'bucketname', // required
'Prefix' => 'subfolder/' // optional (path to folder to stream)
)
);
$stream->send('name-of-zipfile-to-send.zip');
```
## Authors
* Jaisen Mathai - http://jaisenmathai.com
## Dependencies
* Paul Duncan - http://pablotron.org/
* Jonatan Männchen - http://commanders.ch
* Jesse G. Donat - https://donatstudios.com