构造函数有几种情况:
1. 一般的时候初始化使用 $ossClient = new OssClient($id, $key, $endpoint)
2. 如果使用CNAME的,比如使用的是www.testoss.com,在控制台上做了CNAME的绑定,
初始化使用 $ossClient = new OssClient($id, $key, $endpoint, true)
3. 如果使用了阿里云SecurityTokenService(STS),获得了AccessKeyID, AccessKeySecret, Token
初始化使用 $ossClient = new OssClient($id, $key, $endpoint, false, $token)
4. 如果用户使用的endpoint是ip
初始化使用 $ossClient = new OssClient($id, $key, “1.2.3.4:8900”)
public __construct ( string $accessKeyId, string $accessKeySecret, string $endpoint, boolean $isCName = false, string $securityToken = NULL ) | ||
$accessKeyId | string | 从OSS获得的AccessKeyId |
$accessKeySecret | string | 从OSS获得的AccessKeySecret |
$endpoint | string | 您选定的OSS数据中心访问域名,例如oss-cn-hangzhou.aliyuncs.com |
$isCName | boolean | 是否对Bucket做了域名绑定,并且Endpoint参数填写的是自己的域名 |
$securityToken | string |