Skip to content

qiniu/php-sdk

Folders and files

NameName
Last commit message
Last commit date
May 13, 2024
Dec 11, 2023
Oct 25, 2024
Oct 25, 2024
Feb 13, 2017
Sep 21, 2020
Oct 25, 2024
Feb 2, 2015
Feb 3, 2015
Apr 13, 2023
Aug 4, 2023
Sep 6, 2022
Sep 20, 2024
Mar 21, 2019
Aug 21, 2017

Repository files navigation

Qiniu Cloud SDK for PHP

Software License Build Status GitHub release Latest Stable Version Total Downloads Scrutinizer Code Quality Coverage Status Join Chat @qiniu on weibo

安装

推荐使用 composer 进行安装。可以使用 composer.json 声明依赖,或者运行下面的命令。SDK 包已经放到这里 qiniu/php-sdk

$ composer require qiniu/php-sdk

运行环境

Qiniu SDK版本 PHP 版本
7.x cURL extension, 5.3 - 5.6, 7.0 - 7.4, 8.0-8.1
6.x cURL extension, 5.2 - 5.6

使用方法

上传

use Qiniu\Storage\UploadManager;
use Qiniu\Auth;
...
    $uploadMgr = new UploadManager();
    $auth = new Auth($accessKey, $secretKey);
    $token = $auth->uploadToken($bucket);
    list($ret, $error) = $uploadMgr->putFile($token, 'key', 'filePath');
...

测试

$ ./vendor/bin/phpunit tests/Qiniu/Tests/

常见问题

  • $error 保留了请求响应的信息,失败情况下 retnone, 将 $error 可以打印出来,提交给我们。
  • API 的使用 demo 可以参考 examples

代码贡献

详情参考代码提交指南

贡献记录

联系我们

  • 如果需要帮助,请提交工单(在portal右侧点击咨询和建议提交工单,或者直接向 support@qiniu.com 发送邮件)
  • 如果有什么问题,可以到问答社区提问,问答社区
  • 更详细的文档,见官方文档站
  • 如果发现了 bug, 欢迎提交 issue
  • 如果有功能需求,欢迎提交 issue
  • 如果要提交代码,欢迎提交 pull request
  • 欢迎关注我们的微信 微博,及时获取动态信息。

代码许可

The MIT License (MIT).详情见 License文件.