public function create_bucket($bucket, $acl = null, $opt = array())
{
$this->assertParameterArray($opt);
$opt[self::BUCKET] = $bucket;
$opt[self::METHOD] = 'PUT';
$opt[self::OBJECT] = '/';
if (null !== $acl) {
if (!in_array($acl, self::$ACL_TYPES)) {
throw new BCS_Exception("Invalid acl_type[" . $acl . "], please check!", -1);
}
self::set_header_into_opt("x-bs-acl", $acl, $opt);
}
$response = $this->authenticate($opt);
$this->log($response->isOK() ? "Create bucket success!" : "Create bucket failed! Response: [" . $response->body . "]", $opt);
return $response;
}