|
|
3 anos atrás | |
|---|---|---|
| .. | ||
| .github | 3 anos atrás | |
| examples | 3 anos atrás | |
| src | 3 anos atrás | |
| tests | 3 anos atrás | |
| .gitignore | 3 anos atrás | |
| .scrutinizer.yml | 3 anos atrás | |
| CHANGELOG.md | 3 anos atrás | |
| CONTRIBUTING.md | 3 anos atrás | |
| LICENSE | 3 anos atrás | |
| README.md | 3 anos atrás | |
| autoload.php | 3 anos atrás | |
| composer.json | 3 anos atrás | |
| phpunit.xml.dist | 3 anos atrás | |
| test-env.sh | 3 anos atrás | |
composer 进行安装。可以使用 composer.json 声明依赖,或者运行下面的命令。SDK 包已经放到这里 qiniu/php-sdk 。
bash
$ 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文件.