|
|
7 月之前 | |
|---|---|---|
| .. | ||
| .github | 7 月之前 | |
| examples | 7 月之前 | |
| src | 7 月之前 | |
| tests | 7 月之前 | |
| .gitignore | 7 月之前 | |
| .scrutinizer.yml | 7 月之前 | |
| CHANGELOG.md | 7 月之前 | |
| CONTRIBUTING.md | 7 月之前 | |
| LICENSE | 7 月之前 | |
| README.md | 7 月之前 | |
| autoload.php | 7 月之前 | |
| composer.json | 7 月之前 | |
| phpunit.xml.dist | 7 月之前 | |
| test-env.sh | 7 月之前 | |
推荐使用 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 |
| 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 保留了请求响应的信息,失败情况下 ret 为 none, 将 $error 可以打印出来,提交给我们。详情参考代码提交指南。
The MIT License (MIT).详情见 License文件.