loantap / aws
AWS s3,ses,sns,sqs 集成,适用于出色的企业级应用
1.8.2
2023-07-06 10:53 UTC
Requires
- php: >=7.0
- aws/aws-sdk-php: ^3.171
- composer/installers: ~1.0
- oomphinc/composer-installers-extender: ^2.0
- php-mime-mail-parser/php-mime-mail-parser: 5.0.5
README
Aws S3 简码,可以处理所有 AWS S3 操作,如获取、抓取等
使用此功能需要 awesome-enterprise https://github.com/WPoets/awesome-enterprise
composer require loantap/aws
从 S3 桶文件夹获取所有文件
输入
config : <array>
path : <string>
search : <string>
bucket_name : <string>
```
[aws_s3.get_files config=<config-array> path={template.path} search="<search>" bucket_name="<bucket-name>" o.set=template.ack/]
```
获取单个文件内容
###### Input:
config : <array>
path : <string>
bucket_name : <string>
```
[aws_s3.get_file_contents config="<config-array>" path=<path> o.set=template.ack/]
```
保存文件
###### Input:
config : <array>
path : <string>
contents : <string>
```
[aws_s3.put_file_contents config="<config-array>" path="<path>" contents="<content>" o.set=template.ack/]
```
删除单个文件
###### Input:
config : <array>
path : <string>
bucket_name : <string>
```
[aws_s3.delete_file config=<config-array> path={template.path} bucket_name="<bucket-name>" o.set=template.ack/]
```
删除所有文件
###### Input:
config : <array>
path : <string>
bucket_name : <string>
```
[aws_s3.delete_all_files config= path={template.path} bucket_name="" o.set=template.ack/]
```
下载单个文件
输入
config : <array>
path : <string>
bucket_name : <string>
```
[aws_s3.download_file config=<config-array> path={template.path} bucket_name="<bucket-name>" o.set=template.ack/]
```
下载所有文件
###### Input:
config : <array>
path : <string>
bucket_name : <string>
download_path :<string>
```
[aws_s3.download_all config=<config-array> path={template.path} bucket_name="<bucket-name>" download_path="/var/tmp/cibil/{token}.zip" o.set=template.ack/]
```
预签名 URL 和获取文件数据
###### Input:
config : <array>
source : <string>
bucket_name : <string>
destination :<string>
```
[aws_s3.download_public_file config=<config-array> source="<source>" destination="{destination}" bucket_name="<bucket-name>" o.set=template.ack/]
```
在浏览器中显示文件
###### Input:
config : <array>
path : <string>
bucket_name : <string>
```
[aws_s3.read_file config=<config-array> path=<template.path> bucket_name="<bucket-name>" o.set=template.ack/]
```
将本地文件移动到 S3
###### Input:
config : <array>
source : <string>
destination : <string>
bucket_name : <string>
```
[aws_s3.move_file_to_bucket source="{template.local_path}/{template.file_name}" destination="<template.s3_path>" config=<config-array> bucket_name="<bucket-name>" o.set=template.ack/]
```
将对象从一个桶复制到另一个桶
###### Input:
config : <array>
keyname : string
source_bucket : <string>
destination_bucket : <string>
```
[aws_s3.backup_file config="{template.config}" keyname="{template.key_name}" source_bucket="{template.config.bucket}" destination_bucket="{template.config.backup_bucket}" o.set=template.res/]
```
获取电子邮件示例(SES)
###### Input:
file_path : <string>
config : <array>
keyname : <string>
regex_check : <array>
```
[aws_ses.fetch_ses_email config="{template.config}" keyname="{template.key_name}" file_path="{template.file_path}" regex_check={caws.config.regex_pattern} o.set=template.result/]
```