2017 © Pedro Peláez
 

library s3-objects-stream-zip-php

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

image

wgenial/s3-objects-stream-zip-php

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  • Sunday, June 10, 2018
  • by giovanigenerali
  • Repository
  • 3 Watchers
  • 4 Stars
  • 2,182 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 13 Versions
  • 102 % Grown

The README.md

S3ObjectsStreamZip

Packagist PHP Version Codacy GitHub Workflow Status Travis License, (*1)

Overview

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file., (*2)

Uses AWS SDK Version 3 to stream objects directly from S3., (*3)

Install

composer require wgenial/s3-objects-stream-zip-php

Usage

See example folder., (*4)

<?php
  include __DIR__.'/../vendor/autoload.php';

  use Aws\S3\Exception\S3Exception;
  use WGenial\S3ObjectsStreamZip\S3ObjectsStreamZip;
  use WGenial\S3ObjectsStreamZip\Exception\InvalidParamsException;

  try {
    // http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/credentials.html#hardcoded-credentials
    $zipStream = new S3ObjectsStreamZip(array(
      'version' => 'latest', // https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_configuration.html#version
      'region' => 'your-aws-bucket-region', // https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_configuration.html#region
      'credentials' => array(
        'key'    => 'your-aws-key',
        'secret' => 'your-aws-secret'
      ),
      // 'endpoint' => '', // https://docs.aws.amazon.com/general/latest/gr/s3.html
      // 'bucket_endpoint' => '', // https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.S3.S3Client.html#___construct
    ));

    $bucket = 'your-s3-bucket'; // required
    $objects = array(
      array(
        'path' => 'file-text.txt' // required
      ),
      array(
        'name' => 'file-pdf.pdf', // not required
        'path' => 'file-pdf.pdf' // required
      ),
      array(
        'path' => 'logs/file-log.txt' // required
      ),
      array(
        'name' => 'image.png', // you can rename an object to zip, not required
        'path' => 'file-image.png' // required
      )
    );

    $zipname = 'compress.zip'; // required

    $checkObjectExist = false; // no required | default = false

    $zipStream->zipObjects($bucket, $objects, $zipname, $checkObjectExist);
  }
  catch (InvalidParamsException $e) {
    echo $e->getMessage();
  }
  catch (S3Exception $e) {
    echo $e->getMessage();
  }

Dependencies

  • aws/aws-sdk-php
  • maennchen/zipstream-php
  • guzzlehttp/guzzle

Author

Contributors

The Versions

10/06 2018

dev-master

9999999-dev https://github.com/wgenial/s3-objects-stream-zip-php

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compress ziparchive aws-s3 aws-php-sdk amazon-s3 s3-bucket s3-storage amazon-s3-storage

10/06 2018

2.0.1

2.0.1.0 https://github.com/wgenial/s3-objects-stream-zip-php

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compress ziparchive aws-s3 aws-php-sdk amazon-s3 s3-bucket s3-storage amazon-s3-storage

09/06 2018

2.0.0

2.0.0.0 https://github.com/wgenial/s3-objects-stream-zip-php

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compress ziparchive aws-s3 aws-php-sdk amazon-s3 s3-bucket s3-storage amazon-s3-storage

14/02 2018

1.1.5

1.1.5.0 https://github.com/wgenial/s3-objects-stream-zip-php

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compress ziparchive aws-s3 aws-php-sdk amazon-s3 s3-bucket s3-storage amazon-s3-storage

14/02 2018

1.1.4

1.1.4.0 https://github.com/wgenial/s3-objects-stream-zip-php

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compress ziparchive aws-s3 aws-php-sdk amazon-s3 s3-bucket s3-storage amazon-s3-storage

14/02 2018

1.1.3

1.1.3.0 https://github.com/wgenial/s3-objects-stream-zip-php

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compress ziparchive aws-s3 aws-php-sdk amazon-s3 s3-bucket s3-storage amazon-s3-storage

28/10 2017

1.1.2

1.1.2.0 https://github.com/wgenial/s3-objects-stream-zip-php

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compress ziparchive aws-s3 aws-php-sdk amazon-s3 s3-bucket s3-storage amazon-s3-storage

28/10 2017

1.1.1

1.1.1.0 https://github.com/wgenial/s3-objects-stream-zip-php

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compress ziparchive aws-s3 aws-php-sdk amazon-s3 s3-bucket s3-storage amazon-s3-storage

27/10 2017

1.1.0

1.1.0.0 https://github.com/wgenial/s3-objects-stream-zip-php

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  Sources   Download

MIT

The Requires

 

The Development Requires

zip compress ziparchive aws-s3 aws-php-sdk amazon-s3 s3-bucket s3-storage amazon-s3-storage

27/10 2017

1.0.3

1.0.3.0

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  Sources   Download

MIT

The Requires

 

The Development Requires

27/10 2017

1.0.2

1.0.2.0

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  Sources   Download

MIT

The Requires

 

The Development Requires

27/10 2017

1.0.1

1.0.1.0

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  Sources   Download

MIT

The Requires

 

The Development Requires

27/10 2017

1.0.0

1.0.0.0

S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

  Sources   Download

MIT

The Requires

 

The Development Requires