Skip to content

Commit 652ef63

Browse files
committed
Merge pull request #163 from longbai/config_uphost
fixed example file style
2 parents c695f00 + 2b95853 commit 652ef63

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ php:
77
- 5.4
88
- 5.5
99
- 5.6
10+
- 7.0
1011
before_script:
1112
- export QINIU_TEST_ENV="travis"
1213
- travis_retry composer self-update

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#Changelog
22

3+
## 7.0.5 (2015-12-05)
4+
### 修正
5+
* php7.0 Json 对空字符串解析单元测试报错
6+
* 开启安全模式或者设置可操作目录树时,设置CURLOPT_FOLLOWLOCATION报错, by @twocabbages
7+
* fetch 支持不指定key, by @sinkcup
8+
39
## 7.0.4 (2015-07-23)
410
### 修正
511
* 一些地方的严格比较检查

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $ composer require qiniu/php-sdk
2121

2222
| Qiniu SDK版本 | PHP 版本 |
2323
|:--------------------:|:---------------------------:|
24-
| 7.x | cURL extension, 5.3 - 5.6 |
24+
| 7.x | cURL extension, 5.3 - 5.6,7.0 |
2525
| 6.x | cURL extension, 5.2 - 5.6 |
2626

2727
## 使用方法

examples/qetag.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
list($etag, $err) = Etag::sum(__file__);
66
if ($err == null) {
7-
echo "Etag: $etag";
7+
echo("Etag: $etag");
88
} else {
9-
var_dump($err);
10-
}
9+
var_dump($err);
10+
}

src/Qiniu/Http/Client.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,10 @@ private static function sendRequest($request)
8787
);
8888

8989
// Handle open_basedir & safe mode
90-
if (!ini_get('safe_mode') && !ini_get('open_basedir'))
91-
{
90+
if (!ini_get('safe_mode') && !ini_get('open_basedir')) {
9291
$options[CURLOPT_FOLLOWLOCATION] = true;
9392
}
94-
93+
9594
if (!empty($request->headers)) {
9695
$headers = array();
9796
foreach ($request->headers as $key => $val) {

src/Qiniu/functions.php

+3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ function json_decode($json, $assoc = false, $depth = 512)
8787
JSON_ERROR_UTF8 => 'JSON_ERROR_UTF8 - Malformed UTF-8 characters, possibly incorrectly encoded'
8888
);
8989

90+
if (empty($json)) {
91+
return null;
92+
}
9093
$data = \json_decode($json, $assoc, $depth);
9194

9295
if (JSON_ERROR_NONE !== json_last_error()) {

0 commit comments

Comments
 (0)