putBucketAcl() 공개 메소드

设置bucket的ACL配置情况
public putBucketAcl ( string $bucket, string $acl, array $options = NULL ) : null
$bucket string bucket名称
$acl string 读写权限,可选值 ['private', 'public-read', 'public-read-write']
$options array 可以为空
리턴 null
예제 #1
0
/**
 * 设置bucket的acl配置
 *
 * @param OssClient $ossClient OssClient实例
 * @param string $bucket 存储空间名称
 * @return null
 */
function putBucketAcl($ossClient, $bucket)
{
    $acl = OssClient::OSS_ACL_TYPE_PRIVATE;
    try {
        $ossClient->putBucketAcl($bucket, $acl);
    } catch (OssException $e) {
        printf(__FUNCTION__ . ": FAILED\n");
        printf($e->getMessage() . "\n");
        return;
    }
    print __FUNCTION__ . ": OK" . "\n";
}