gromnan/s3-zip
最新稳定版本:v1.1.0
Composer 安装命令:
composer require gromnan/s3-zip
包简介
Read partial zip on AWS S3 or HTTP
README 文档
README
Having a ZIP archive hosted on AWS S3 or an HTTP(S) server? How to list files in the archive or read only 1 file without downloading the whole archive?
This packages use the Range: bytes=%d-%d header to download only the necessary chunks for listing files or reading a single file.
Installation
Use composer to install gromnan/s3-zip from packagist.
composer require gromnan/s3-zip
Usage
use AsyncAws\S3\S3Client; use GromNaN\S3Zip\Archive; use GromNaN\S3Zip\Input\S3Input; use Symfony\Component\HttpClient\HttpClient; use Symfony\Component\HttpKernel\Log\Logger; $logger = new Logger(); $httpClient = HttpClient::create()->setLogger($logger); $s3 = new S3Client([/* AWS Config */], null, $httpClient, $logger); $filename = 's3://my-bucket/path/to/archive.zip'; $input = new S3Input($s3, $filename); $input->setLogger($logger); $archive = new Archive($input); // Get the list for file names in the archive var_dump($archive->getFileNames()); // Downloads and extracts the contents of a single file echo $archive->getFile('path/to/file/in/archive.txt')->getContents();
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
References
统计信息
- 总下载量: 892
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-02-01