@@ -25,8 +25,6 @@ class Client extends GSClient {
2525 private $ schema ;
2626 private $ ip ;
2727 private $ port ;
28-
29-
3028 public function __construct ($ config ) {
3129 $ this ->region = $ config ['region ' ];
3230 $ regionmap = array ('cn-east ' =>'ap-shanghai ' ,
@@ -44,6 +42,7 @@ public function __construct($config) {
4442 $ this ->schema = isset ($ config ['schema ' ]) ? $ config ['schema ' ] : 'http ' ;
4543 $ this ->ip = isset ($ config ['ip ' ]) ? $ config ['ip ' ] : null ;
4644 $ this ->port = isset ($ config ['port ' ]) ? $ config ['port ' ] : null ;
45+ $ this ->endpoint = isset ($ config ['endpoint ' ]) ? $ config ['endpoint ' ] : null ;
4746 $ this ->region = isset ($ regionmap [$ this ->region ]) ? $ regionmap [$ this ->region ] : $ this ->region ;
4847 $ this ->credentials = $ config ['credentials ' ];
4948 $ this ->appId = isset ($ config ['credentials ' ]['appId ' ]) ? $ config ['credentials ' ]['appId ' ] : null ;
@@ -64,7 +63,7 @@ public function __construct($config) {
6463 $ this ->addSubscriber (new Md5Listener ($ this ->signature ));
6564 $ this ->addSubscriber (new TokenListener ($ this ->token ));
6665 $ this ->addSubscriber (new SignatureListener ($ this ->secretId , $ this ->secretKey ));
67- $ this ->addSubscriber (new BucketStyleListener ($ this ->appId , $ this ->ip , $ this ->port ));
66+ $ this ->addSubscriber (new BucketStyleListener ($ this ->appId , $ this ->ip , $ this ->port , $ this -> endpoint ));
6867 // Allow for specifying bodies with file paths and file handles
6968 $ this ->addSubscriber (new UploadBodyListener (array ('PutObject ' , 'UploadPart ' )));
7069 }
0 commit comments