Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🗜️ 3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

License

NotificationsYou must be signed in to change notification settings

wgenial/s3-objects-stream-zip-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PackagistPHP VersionCodacyGitHub Workflow StatusTravisLicense

Overview

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

Uses AWS SDK Version 3 tostream objects directly from S3.

Install

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

Usage

Seeexample folder.

<?phpinclude__DIR__.'/../vendor/autoload.php';useAws\S3\Exception\S3Exception;useWGenial\S3ObjectsStreamZip\S3ObjectsStreamZip;useWGenial\S3ObjectsStreamZip\Exception\InvalidParamsException;try {// http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/credentials.html#hardcoded-credentials$zipStream =newS3ObjectsStreamZip(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

About

🗜️ 3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.

Topics

Resources

License

Stars

Watchers

Forks

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp