Skip to content

Commit 0ec70f1

Browse files
committed
- 修复腾讯云存储
- 数组门面增加方法
1 parent fe03e1b commit 0ec70f1

File tree

66 files changed

+10912
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+10912
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v6.0.127 / 2020-11-25
2+
- 修复腾讯云存储
3+
- 数组门面增加方法
4+
15
## v6.0.126 / 2020-11-19
26
- 优化淘宝官方SDK
37

src/common.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/**
2626
* 定义当前版本
2727
*/
28-
const VERSION = '6.0.126';
28+
const VERSION = '6.0.127';
2929

3030
if (!function_exists('get_ip_info')) {
3131
/**

src/facade/Arrays.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
* @method static array unique(array $array) 多维数组去重
3838
* @method static array sort(array $arrays, string $sort_key, $sort_order = SORT_ASC, $sort_type = SORT_NUMERIC) 二维数组根据某个键排序
3939
* @method static array trimArray(array $arr) 数组删除空格
40+
* @method static array toArray($output) 把json字符串或json对象转json数组
4041
*/
4142
class Arrays extends Facade
4243
{

src/helper/Arrays.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,20 @@ private function trimAll($str)
151151
$newchar = array("", "", "", "", "");
152152
return str_replace($oldchar, $newchar, $str);
153153
}
154+
155+
/**
156+
* 把json字符串或json对象转json数组
157+
* @param $output
158+
* @return array
159+
*/
160+
public function toArray($output): array
161+
{
162+
if (is_array($output)) {
163+
return $output;
164+
}
165+
if (is_object($output)) {
166+
$output = json_encode($output, JSON_UNESCAPED_UNICODE);
167+
}
168+
return json_decode($output, true);
169+
}
154170
}

0 commit comments

Comments
 (0)