jmathai/s3-bucket-stream-zip-php

PHP库,用于高效地将AWS S3存储桶或文件夹的内容流式传输为zip文件

v2.0 2017-03-02 19:06 UTC

This package is not auto-updated.

Last update: 2024-09-14 17:48:27 UTC


README

Build Status Scrutinizer Code Quality Code Coverage

概述

此库允许您将S3存储桶/文件夹的内容高效地流式传输为zip文件到客户端。

安装

通过composer安装,添加对jmathai/s3-bucket-stream-zip-php的依赖。

composer require jmathai/s3-bucket-stream-zip-php
composer install

用法

// 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');

作者

依赖