2017 © Pedro Peláez
 

library s3-bucket-stream-zip-php

PHP library to efficiently stream contents from an AWS S3 bucket or folder as a zip file

image

ffogarasi/s3-bucket-stream-zip-php

PHP library to efficiently stream contents from an AWS S3 bucket or folder as a zip file

  • Tuesday, July 25, 2017
  • by ffogarasi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 33 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 0 Open issues
  • 7 Versions
  • 65 % Grown

The README.md

S3BucketStreamZip

Forked from Michaeltlee/s3-bucket-stream-zip-php, (*1)

Overview

This library lets you efficiently stream the contents of an S3 bucket/folder as a zip file to the client., (*2)

Uses v3 of AWS SDK to stream files directly from S3., (*3)

Installation

Installation is done via composer by adding the a dependency on ., (*4)

composer require ffogarasi/s3-bucket-stream-zip-php

Usage

// 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 Aws\S3\Exception\S3Exception;
use MTL\S3BucketStreamZip\Exception\InvalidParameterException;
use MTL\S3BucketStreamZip\S3BucketStreamZip;

$auth = [
    'key'     => '*****',
    'secret'  => '*****',
    'region'  => 'us-east-1', // optional. defaults to us-east-1
    'version' => 'latest' // optional. defaults to latest
];

$stream = new S3BucketStreamZip($auth);

try {
    $stream->bucket('testbucket')
           ->prefix('testfolder') // prefix method adds a trailing '/'
           ->send('name-of-zipfile-to-send.zip');
} catch (InvalidParameterException $e) {
    // handle the exception
    echo $e->getMessage();
} catch (S3Exception $e) {
    // handle the exception
    echo $e->getMessage();
}
$stream->bucket('another-test-bucket')
       ->prefix('test/')
       ->addParams([
           'MaxKeys' => 1, // array of other parameters
       ])
       ->send('zipfile-to-send.zip');

// if prefix is not supplied, entire bucket contents are streamed $stream->bucket('another-test-bucket') ->send('zipfile-to-send.zip');

Laravel 5.4

  • pa make:provider AWSZipStreamServiceProvider and copy the contents examples/AwsZipStreamServiceProvider.php.
  • Make sure your config values are all set.
  • Register the provider in config/app.php.

OR in config/app.php

'providers' => [
    ...
    MTL\S3BucketStreamZip\AWSZipStreamServiceProvider::class,
    ...
]

in config/services.php, set:, (*5)

's3' => [
    'key'     => '', 
    'secret'  => '', 
    'region'  => '',
    'version' => '',
];

Authors

Dependencies

The Versions

25/07 2017

dev-master

9999999-dev https://github.com/ffogarasi/s3-bucket-stream-zip-php

PHP library to efficiently stream contents from an AWS S3 bucket or folder as a zip file

  Sources   Download

MIT

The Requires

 

The Development Requires

php amazon s3 aws zip stream download

25/07 2017

4.0.1

4.0.1.0 https://github.com/ffogarasi/s3-bucket-stream-zip-php

PHP library to efficiently stream contents from an AWS S3 bucket or folder as a zip file

  Sources   Download

MIT

The Requires

 

The Development Requires

php amazon s3 aws zip stream download

13/03 2017

v4.0.0

4.0.0.0 https://github.com/michaeltlee/s3-bucket-stream-zip-php

PHP library to efficiently stream contents from an AWS S3 bucket or folder as a zip file

  Sources   Download

MIT

The Requires

 

The Development Requires

php amazon s3 aws zip stream download

09/03 2017

v3.0.0

3.0.0.0 https://github.com/michaeltlee/s3-bucket-stream-zip-php

PHP library to efficiently stream contents from an AWS S3 bucket or folder as a zip file

  Sources   Download

MIT

The Requires

 

The Development Requires

php amazon s3 aws zip stream download

28/02 2017

v2.0.0

2.0.0.0 https://github.com/michaeltlee/s3-bucket-stream-zip-php

PHP library to efficiently stream contents from an AWS S3 bucket or folder as a zip file

  Sources   Download

MIT

The Requires

 

The Development Requires

php amazon s3 aws zip stream download

29/11 2015

1.0.1

1.0.1.0 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

  Sources   Download

MIT

The Requires

 

The Development Requires

php amazon s3 aws zip stream download

06/03 2015

1.0.0

1.0.0.0 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

  Sources   Download

MIT

The Requires

 

The Development Requires

php amazon s3 aws zip stream download