To use the SDK, you must instantiate a Qcloud\Cos\Client with your region and credentials.
Standard Credentials:
Use secretId and secretKey.
Temporary Credentials:
If using temporary security credentials, you must also provide the token (XCosSecurityToken).
// Standard initialization
$cosClient = new Qcloud\Cos\Client(array(
'region' => '<Region>',
'credentials' => array(
'secretId' => '<SecretId>',
'secretKey' => '<SecretKey>'
)
));
// Temporary credentials initialization
$cosClient = new Qcloud\Cos\Client(array(
'region' => '<Region>',
'credentials' => array(
'secretId' => '<SecretId>',
'secretKey' => '<SecretKey>',
'token' => '<XCosSecurityToken>'
)
));