wgenial/s3-objects-stream-zip-php
Composer 安装命令:
composer require wgenial/s3-objects-stream-zip-php
包简介
S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.
关键字:
README 文档
README
Overview
S3ObjectsStreamZip is a PHP library to stream objects from AWS S3 as a zip file.
Uses AWS SDK Version 3 to stream objects directly from S3.
Install
composer require wgenial/s3-objects-stream-zip-php
Usage
See example folder.
<?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-phpmaennchen/zipstream-phpguzzlehttp/guzzle
Author
Contributors
wgenial/s3-objects-stream-zip-php 适用场景与选型建议
wgenial/s3-objects-stream-zip-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 90.23k 次下载、GitHub Stars 达 20, 最近一次更新时间为 2017 年 10 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「compress」 「ziparchive」 「zip」 「aws-s3」 「aws-php-sdk」 「amazon-s3」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 wgenial/s3-objects-stream-zip-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wgenial/s3-objects-stream-zip-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wgenial/s3-objects-stream-zip-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CSS/Javascript Minificator, Compressor and Concatenator for TYPO3 - highly configurable frontend asset optimization for CSS/JS merging, minification and compression with optional body parsing, async/defer loading, inline output, data-ignore exclusions, SRI integrity validation/calculation, external
Allow packages to be installed from a repository or tarball bundle that have multiple packages in the sub-folders
Iteration tools for PHP
OriginPHP Html
a simple and powerful zip manipulation library
ZipArchive extended with support for UTF-8 encoded strings using base64.
统计信息
- 总下载量: 90.23k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 21
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-10-26