swoft-components/cloud-storage
最新稳定版本:v3.0.0-beta
Composer 安装命令:
composer require swoft-components/cloud-storage
包简介
cloud storage component for swoft, now support qiniu cloud storage
README 文档
README
intro
This component is a cloud storage component for swoft. Current version 2.0.1, support qiniu cloud storage.
Install
- composer command
composer require swoft/cloud-storage
LICENSE
The Component is open-sourced software licensed under the Apache license.
Usage
// bean.php 中配置 bean 定义 // accessKey, secretKey 可以在 qiniu 个人中心获取, bucket 是七牛的空间名称 return [ ... 'qiniu' => [ 'bucket' => '配置七牛bucket名称' ], 'qiniuAuth' => [ 'accessKey' => '配置授权秘钥 key', 'secretKey' => '配置授权秘钥 secret', ], ... ];
// 上传文件到七牛云 use Swoft\CloudStorage\CloudStorage; use Swoft\CloudStorage\CloudStorageType; $cloudFileName = 'test.jpg'; $localFilePath = __DIR__. DIRECTORY_SEPARATOR. 'test.jpg'; // upload file to cloud qiniu $result = CloudStorage::upload($cloudFileName, $localFilePath, CloudStorageType::QINIU); var_dump($result);
统计信息
- 总下载量: 197
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2025-05-15