softsmart/awss3
Composer 安装命令:
composer require softsmart/awss3
包简介
Simple AWSS3 implementation
README 文档
README
A simple AWS S3 GET, PUT, DELETE implementation in PHP using AWS Rest interface
Install
Via Composer
$ composer require softsmart/awss3
Usage
$object = new AWSS3();
$awsAccessKeyId = "MyAwsAccessKeyId";
$awsSecretAccessKey = "My/AwsSecret/Access/Key";
$bucketName = "MyBucketName";
$region = "us-east-2";
// GET an object
$return = $object->get('/dog.png', $awsAccessKeyId, $awsSecretAccessKey, $bucketName, $region);
if ($return["httpCode"] == 200) {
file_put_contents(dirname(__FILE__)."/dog.png", $return["content"]);
print "<img src=\"dog.png\">";
}
// PUT an object
$return = $object->put(dirname(__FILE__)."/dog.png", "/dog.png", $awsAccessKeyId, $awsSecretAccessKey, $bucketName, $region);
// DELETE an object
$return = $object->delete('/dog.png', $awsAccessKeyId, $awsSecretAccessKey, $bucketName, $region);
Testing
$ phpcs -c phpunit.xml
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Credits
License
GNU GENERAL PUBLIC LICENSE. Please see License File for more information.
Questions
Q: Why not just use their SDK?
A: Its probably best but the SDK is for all Amazon products. It seems like overkill if all you want to do is add and delete files to an S3 bucket (eg, for remote images).
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-only
- 更新时间: 2020-04-25