@@ -14,8 +14,8 @@ class Config extends Collection
1414 */
1515 public function getUrlDomain ()
1616 {
17- if ($ this ->get (' domain ' )) {
18- return $ this ->getProtocol ().' :// ' .$ this ->get (' domain ' );
17+ if ($ this ->get (" domain " )) {
18+ return $ this ->getProtocol ()." :// " .$ this ->get (" domain " );
1919 }
2020 return $ this ->getEndpointDomain ();
2121 }
@@ -25,44 +25,45 @@ public function getUrlDomain()
2525 */
2626 protected function getEndpointDomain ()
2727 {
28- return $ this ->getProtocol ().' :// ' .$ this ->get (' bucket ' ). ' . ' .$ this ->get (' endpoint ' );
28+ return $ this ->getProtocol ()." :// " .$ this ->get (" bucket " ). " . " .$ this ->get (" endpoint " );
2929 }
30+
3031 /**
3132 * @return string
3233 */
3334 protected function getInternalDomain ()
3435 {
35- return $ this ->getProtocol ().' :// ' .$ this ->get (' bucket ' ). ' . ' .$ this ->get (' internal ' );
36+ return $ this ->getProtocol ()." :// " .$ this ->get (" bucket " ). " . " .$ this ->get (" internal " );
3637 }
3738
3839 /**
3940 * @return string
4041 */
4142 protected function getProtocol ()
4243 {
43- return $ this ->get (' use_ssl ' , false ) ? ' https ' : ' http ' ;
44+ return $ this ->get (" use_ssl " , false ) ? " https " : " http " ;
4445 }
4546
4647 /**
4748 * @return string
4849 */
4950 public function getOssEndpoint ()
5051 {
51- if ($ internal = $ this ->get (' internal ' )) {
52+ if ($ internal = $ this ->get (" internal " )) {
5253 return $ internal ;
5354 }
5455 if ($ this ->isCName ()) {
55- return $ this ->get (' domain ' );
56+ return $ this ->get (" domain " );
5657 }
57- return $ this ->get (' endpoint ' );
58+ return $ this ->get (" endpoint " );
5859 }
5960
6061 /**
6162 * @return bool
6263 */
63- protected function isCName ()
64+ public function isCName ()
6465 {
65- return $ this ->get (' use_domain_endpoint ' ) && $ this ->get (' domain ' );
66+ return $ this ->get (" use_domain_endpoint " , false ) && $ this ->get (" domain " );
6667 }
6768
6869 /**
@@ -71,11 +72,12 @@ protected function isCName()
7172 public function getOssClientParameters ()
7273 {
7374 return [
74- 'accessKeyId ' => $ this ->get ('access_id ' ),
75- 'accessKeySecret ' => $ this ->get ('access_key ' ),
76- 'endpoint ' => $ this ->getOssEndpoint (),
77- 'isCName ' => $ this ->isCName (),
78- 'securityToken ' => $ this ->get ('security_token ' , null )
75+ "accessKeyId " => $ this ->get ("access_id " ),
76+ "accessKeySecret " => $ this ->get ("access_key " ),
77+ "endpoint " => $ this ->getOssEndpoint (),
78+ "isCName " => $ this ->isCName (),
79+ "securityToken " => $ this ->get ("security_token " , null ),
80+ "requestProxy " => $ this ->get ("request_proxy " , null )
7981 ];
8082 }
8183
@@ -85,13 +87,11 @@ public function getOssClientParameters()
8587 */
8688 public function correctUrl ($ url )
8789 {
88- // correct internal domain
89- if ($ this ->get ('internal ' )) {
90+ if ($ this ->get ("internal " )) {
9091 return str_replace ($ this ->getInternalDomain (), $ this ->getUrlDomain (), $ url );
9192 }
9293
93- // correct domain
94- if ($ this ->get ('domain ' ) && $ this ->get ('use_domain_endpoint ' ) == false ) {
94+ if ($ this ->get ("domain " ) && $ this ->get ("use_domain_endpoint " ) == false ) {
9595 return str_replace ($ this ->getEndpointDomain (), $ this ->getUrlDomain (), $ url );
9696 }
9797
0 commit comments