|
|
%!s(int64=4) %!d(string=hai) anos | |
|---|---|---|
| .. | ||
| docs | %!s(int64=4) %!d(string=hai) anos | |
| examples | %!s(int64=4) %!d(string=hai) anos | |
| src | %!s(int64=4) %!d(string=hai) anos | |
| tests | %!s(int64=4) %!d(string=hai) anos | |
| .gitignore | %!s(int64=4) %!d(string=hai) anos | |
| .scrutinizer.yml | %!s(int64=4) %!d(string=hai) anos | |
| .travis.yml | %!s(int64=4) %!d(string=hai) anos | |
| CHANGELOG.md | %!s(int64=4) %!d(string=hai) anos | |
| CONTRIBUTING.md | %!s(int64=4) %!d(string=hai) anos | |
| LICENSE | %!s(int64=4) %!d(string=hai) anos | |
| README.md | %!s(int64=4) %!d(string=hai) anos | |
| autoload.php | %!s(int64=4) %!d(string=hai) anos | |
| composer.json | %!s(int64=4) %!d(string=hai) anos | |
| phpunit.xml.dist | %!s(int64=4) %!d(string=hai) anos | |
| test-env.sh | %!s(int64=4) %!d(string=hai) anos | |
通过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;
...
$upManager = new UploadManager();
$auth = new Auth($accessKey, $secretKey);
$token = $auth->uploadToken($bucketName);
list($ret, $error) = $upManager->put($token, 'formput', 'hello world');
...
$ ./vendor/bin/phpunit tests/Qiniu/Tests/
详情参考代码提交指南。
The MIT License (MIT).详情见 License文件.