dealnews/storage
最新稳定版本:2.1.0
Composer 安装命令:
composer require dealnews/storage
包简介
Object Storage
README 文档
README
This library provides an interface to store and retrieve objects from services such as S3.
use DealNews\ObjectStorage\Storage; use DealNews\ObjectStorage\Backends\S3; // the options array for S3 can contain a profile name which will use // GetConfig to find the other values in config.ini or it can contain // bucket, region, key, and secret. $storage = new Storage(S3::init(['profile' => 'get_config_name'])); $object = $storage->store( $filename, 'object/path/name', 'content/type', [ 'meta' => 'data' ], 'public' // ACL setting defaults to bucket default ); echo json_encode($object, JSON_PRETTY_PRINT);
A DealNews\ObjectStorage\Data\StorageObject object is returned from the
get, head, and store methods. Both the store and head methods will
not return the object's body in the object_data property. The get method
will fill the object_data property with the object's body. The delete
method returns a boolean.
{
"object_storage_id": "QpFqF6v0BO7dhvNPVZO46t5by5lCRrlciL7GH8Quvc0vADZt/UU5zKCu2dHfibdIC33jb2p+fVs=",
"container": "bucket_name",
"key": "object/path/name",
"url_path": "/bucket_name/object/path/name",
"storage_url": "s3://bucket_name/object/path/name",
"content_type": "text/plain",
"meta_data": {
"Meta": "data"
},
"last_modified": "Fri, 13 Aug 2021 21:27:47 GMT",
"object_data": null
}
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-09-04