Skip to content

Commit d5d6f4d

Browse files
committed
init doc
1 parent 9e877e8 commit d5d6f4d

File tree

5 files changed

+96
-26
lines changed

5 files changed

+96
-26
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Changelog
2+
3+
## 7.0.0 (2015-02-03)
4+
5+
### 增加
6+
* 简化上传接口
7+
* 自动选择断点续上传还是直传
8+
* 重构代码,接口和内部结构更清晰
9+
* 改变mime
10+
* 代码覆盖度报告
11+
* policy改为array, 便于灵活增加,并加入过期字段检查
12+
* 文件列表支持目录形式

CONTRIBUTING.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# 贡献代码指南
2+
3+
我们非常欢迎大家来贡献代码,我们会向贡献者致以最诚挚的敬意。
4+
5+
一般可以通过在Github上提交[Pull Request](https://github.com/qiniu/php-sdk)来贡献代码。
6+
7+
## Pull Request要求
8+
9+
- **[PSR-2 编码风格标准](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** 。要通过项目中的code sniffer检查。
10+
11+
- **代码格式** 提交前 请按 ./vendor/bin/phpcbf --standard=PSR2 进行格式化。
12+
13+
- **必须添加测试!** - 如果没有测试(单元测试、集成测试都可以),那么提交的补丁是不会通过的。
14+
15+
- **记得更新文档** - 保证`README.md`以及其他相关文档及时更新,和代码的变更保持一致性。
16+
17+
- **考虑我们的发布周期** - 我们的版本号会服从[SemVer v2.0.0](http://semver.org/),我们绝对不会随意变更对外的API。
18+
19+
- **创建feature分支** - 最好不要从你的master分支提交 pull request。
20+
21+
- **一个feature提交一个pull请求** - 如果你的代码变更了多个操作,那就提交多个pull请求吧。
22+
23+
- **清晰的commit历史** - 保证你的pull请求的每次commit操作都是有意义的。如果你开发中需要执行多次的即时commit操作,那么请把它们放到一起再提交pull请求。
24+
25+
## 运行测试
26+
27+
``` bash
28+
./vendor/bin/phpunit tests/Qiniu/Tests/
29+
30+
```

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014 Bai Long
3+
Copyright (c) 2014 Qiniu
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+52-24
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,69 @@
1-
# Qiniu Resource Storage SDK for PHP
1+
# Qiniu PHP SDK
2+
[![@qiniu on weibo](http://img.shields.io/badge/weibo-%40qiniutek-blue.svg)](http://weibo.com/qiniutek)
3+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE.md)
4+
[![Build Status](https://travis-ci.org/qiniu/php-sdk.svg)](https://travis-ci.org/qiniu/php-sdk)
5+
[![Latest Stable Version](https://img.shields.io/pypi/v/qiniu.svg)](https://pypi.python.org/pypi/qiniu)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/qiniu/php-sdk.svg)](https://packagist.org/packages/qiniu/php-sdk)
7+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/qiniu/php-sdk/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/qiniu/php-sdk/?branch=master)
8+
[![Code Coverage](https://scrutinizer-ci.com/g/qiniu/php-sdk/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/qiniu/php-sdk/?branch=master)
9+
## 安装
210

3-
[![Build Status](https://api.travis-ci.org/qiniu/php-sdk.png?branch=master)](https://travis-ci.org/qiniu/php-sdk)
11+
1. 通过composer
12+
```bash
13+
$ composer require qiniu/php-sdk
14+
```
15+
2. 直接下载安装,SDK 没有依赖其他第三方库,但需要使用composer的autoload
416

5-
[![Qiniu Logo](http://qiniu-brand.qiniudn.com/5/logo-white-195x105.png)](http://www.qiniu.com/)
17+
## 运行环境
618

19+
| Qiniu SDK版本 | PHP 版本 |
20+
|:--------------------:|:---------------------------:|
21+
| 7.x | cURL extension, 5.3 - 5.6 |
22+
| 6.x | cURL extension, 5.2 - 5.6 |
723

8-
## 下载
24+
## 使用方法
925

10-
### 从 release 版本下载
26+
### 上传
27+
```php
28+
use Qiniu\Storage\UploadManager;
29+
use Qiniu\Auth;
30+
...
31+
$upManager = new UploadManager();
32+
$auth = new Auth($accessKey, $secretKey);
33+
$token = $auth->uploadToken($bucketName);
34+
list($ret, $error) = $upManager->put($token, 'formput', 'hello world');
35+
...
36+
```
1137

12-
下载地址:https://github.com/qiniu/php-sdk/releases
38+
## 测试
1339

14-
这是我们建议的方式,release 版本有版本号,有 [CHANGELOG](https://github.com/qiniu/php-sdk/blob/develop/CHANGELOG.md),使用规格也会比较稳定。
40+
``` bash
41+
$ ./vendor/bin/phpunit tests/Qiniu/Tests/
42+
```
1543

16-
### 从 git 库下载
44+
## 常见问题
1745

18-
你可以直接用 git clone 下载源代码来使用。但是请注意非 master 分支的代码在规格上可能承受变更,应谨慎使用。
46+
- $error保留了请求响应的信息,失败情况下ret 为none, 将$error可以打印出来,提交给我们。
47+
- API 的使用 demo 可以参考 [单元测试](https://github.com/qiniu/php-sdk/blob/master/tests)
1948

49+
## 代码贡献
2050

21-
## 使用
51+
详情参考[代码提交指南](https://github.com/qiniu/php-sdk/blob/master/CONTRIBUTING.md)
2252

23-
参考文档:[七牛云存储 PHP SDK 使用指南](https://github.com/qiniu/php-sdk/tree/develop/docs)
53+
## 贡献记录
2454

55+
- [所有贡献者](https://github.com/qiniu/php-sdk/contributors)
2556

26-
## 贡献代码
57+
## 联系我们
2758

28-
1. Fork
29-
2. 创建您的特性分支 (`git checkout -b my-new-feature`)
30-
3. 提交您的改动 (`git commit -am 'Added some feature'`)
31-
4. 将您的修改记录提交到远程 `git` 仓库 (`git push origin my-new-feature`)
32-
5. 然后到 github 网站的该 `git` 远程仓库的 `my-new-feature` 分支下发起 Pull Request
59+
- 如果需要帮助,请提交工单(在portal右侧点击咨询和建议提交工单,或者直接向 [email protected] 发送邮件)
60+
- 如果有什么问题,可以到问答社区提问,[问答社区](http://qiniu.segmentfault.com/)
61+
- 更详细的文档,见[官方文档站](http://developer.qiniu.com/)
62+
- 如果发现了bug, 欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues)
63+
- 如果有功能需求,欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues)
64+
- 如果要提交代码,欢迎提交 pull request
65+
- 欢迎关注我们的[微信](http://www.qiniu.com/#weixin) [微博](http://weibo.com/qiniutek),及时获取动态信息。
3366

67+
## 代码许可
3468

35-
## 许可证
36-
37-
Copyright (c) 2012-2014 qiniu.com
38-
39-
基于 MIT 协议发布:
40-
41-
* [www.opensource.org/licenses/MIT](http://www.opensource.org/licenses/MIT)
69+
The MIT License (MIT).详情见 [License文件](https://github.com/qiniu/php-sdk/blob/master/LICENSE).

src/Qiniu/Processing/Operation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
final class Operation
55
{
6-
public static function buildOp($cmd, $first_arg, array $args)
6+
public static function buildOp($cmd, $first_arg, array $args = array())
77
{
88
$op = array($cmd);
99
if (!empty($first_arg)) {

0 commit comments

Comments
 (0)