File tree Expand file tree Collapse file tree 5 files changed +44
-5
lines changed Expand file tree Collapse file tree 5 files changed +44
-5
lines changed Original file line number Diff line number Diff line change 1
1
cos-php-sdk-v5 Upgrade Guide
2
2
====================
3
+ 2.1.5 to 2.1.6
4
+ ----------
5
+ - Add ` allow_redirects ` parameter
6
+ - Fix ` selectObjectContent ` interface
7
+
3
8
2.1.3 to 2.1.5
4
9
----------
5
10
- The ` download ` interface supports breakpoint
Original file line number Diff line number Diff line change 19
19
'proxy ' => '' , //代理服务器
20
20
'retry ' => 10 , //重试次数
21
21
'userAgent ' => '' , //UA
22
+ 'allow_redirects ' => false , //是否follow302
22
23
'credentials ' => array (
23
24
'secretId ' => $ secretId ,
24
25
'secretKey ' => $ secretKey ,
Original file line number Diff line number Diff line change 52
52
// 请求失败
53
53
echo ($ e );
54
54
}
55
+
56
+ try {
57
+ $ result = $ cosClient ->selectObjectContent (array (
58
+ 'Bucket ' => $ bucket , //格式:BucketName-APPID
59
+ 'Key ' => $ key ,
60
+ 'Expression ' => 'Select * from COSObject s ' ,
61
+ 'ExpressionType ' => 'SQL ' ,
62
+ 'InputSerialization ' => array (
63
+ 'CompressionType ' => 'None ' ,
64
+ 'JSON ' => array (
65
+ 'Type ' => 'DOCUMENT '
66
+ )
67
+ ),
68
+ 'OutputSerialization ' => array (
69
+ 'JSON ' => array (
70
+ 'RecordDelimiter ' => '\n ' ,
71
+ )
72
+ ),
73
+ 'RequestProgress ' => array (
74
+ 'Enabled ' => 'FALSE '
75
+ )
76
+ ));
77
+ // 请求成功
78
+ foreach ($ result ['Data ' ] as $ data ) {
79
+ // 迭代遍历select结果
80
+ print_r ($ data );
81
+ }
82
+ } catch (\Exception $ e ) {
83
+ // 请求失败
84
+ echo ($ e );
85
+ }
Original file line number Diff line number Diff line change 77
77
* @method object GetBucketIntelligentTiering (array $arg)
78
78
*/
79
79
class Client extends GuzzleClient {
80
- const VERSION = '2.1.5 ' ;
80
+ const VERSION = '2.1.6 ' ;
81
81
82
82
public $ httpClient ;
83
83
@@ -108,6 +108,7 @@ public function __construct($cosConfig) {
108
108
$ this ->cosConfig ['retry ' ] = isset ($ cosConfig ['retry ' ]) ? $ cosConfig ['retry ' ] : 1 ;
109
109
$ this ->cosConfig ['userAgent ' ] = isset ($ cosConfig ['userAgent ' ]) ? $ cosConfig ['userAgent ' ] : 'cos-php-sdk-v5. ' . Client::VERSION ;
110
110
$ this ->cosConfig ['pathStyle ' ] = isset ($ cosConfig ['pathStyle ' ]) ? $ cosConfig ['pathStyle ' ] : false ;
111
+ $ this ->cosConfig ['allow_redirects ' ] = isset ($ cosConfig ['allow_redirects ' ]) ? $ cosConfig ['allow_redirects ' ] : false ;
111
112
112
113
$ service = Service::getService ();
113
114
$ handler = HandlerStack::create ();
@@ -130,6 +131,7 @@ public function __construct($cosConfig) {
130
131
'timeout ' => $ this ->cosConfig ['timeout ' ],
131
132
'handler ' => $ handler ,
132
133
'proxy ' => $ this ->cosConfig ['proxy ' ],
134
+ 'allow_redirects ' => $ this ->cosConfig ['allow_redirects ' ]
133
135
]);
134
136
$ this ->desc = new Description ($ service );
135
137
$ this ->api = (array )($ this ->desc ->getOperations ());
Original file line number Diff line number Diff line change @@ -2718,8 +2718,8 @@ public static function getService() {
2718
2718
)
2719
2719
),
2720
2720
'JSON ' => array (
2721
- 'type ' => 'string ' ,
2722
- 'location ' => 'object ' ,
2721
+ 'type ' => 'object ' ,
2722
+ 'location ' => 'xml ' ,
2723
2723
'properties ' => array (
2724
2724
'Type ' => array (
2725
2725
'type ' => 'string ' ,
@@ -2764,8 +2764,8 @@ public static function getService() {
2764
2764
)
2765
2765
),
2766
2766
'JSON ' => array (
2767
- 'type ' => 'string ' ,
2768
- 'location ' => 'object ' ,
2767
+ 'type ' => 'object ' ,
2768
+ 'location ' => 'xml ' ,
2769
2769
'properties ' => array (
2770
2770
'RecordDelimiter ' => array (
2771
2771
'type ' => 'string ' ,
You can’t perform that action at this time.
0 commit comments