dream 050bfac24d 1 | 8 months ago | |
---|---|---|
.. | ||
docs | 8 months ago | |
examples | 8 months ago | |
src | 8 months ago | |
tests | 8 months ago | |
.gitignore | 8 months ago | |
.scrutinizer.yml | 8 months ago | |
.travis.yml | 8 months ago | |
CHANGELOG.md | 8 months ago | |
CONTRIBUTING.md | 8 months ago | |
LICENSE | 8 months ago | |
README.md | 8 months ago | |
autoload.php | 8 months ago | |
composer.json | 8 months ago | |
phpunit.xml.dist | 8 months ago | |
test-env.sh | 8 months ago |
通过composer,这是推荐的方式,可以使用composer.json 声明依赖,或者运行下面的命令。SDK 包已经放到这里 qiniu/php-sdk
。
$ composer require qiniu/php-sdk
直接下载安装,SDK 没有依赖其他第三方库,但需要参照 composer的autoloader,增加一个自己的autoloader程序。
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文件.