ALIOSS::create_bucket PHP Method

create_bucket() public method

Create Bucket
Since: 2011-11-14
public create_bucket ( string $bucket, string $acl = self::OSS_ACL_TYPE_PRIVATE, array $options = null ) : ResponseCore
$bucket string (Required)
$acl string (Optional)
$options array (Optional)
return ResponseCore
    public function create_bucket($bucket, $acl = self::OSS_ACL_TYPE_PRIVATE, $options = null)
    {
        //$options
        $this->validate_options($options);
        if (!$options) {
            $options = array();
        }
        //bucket
        $this->is_empty($bucket, OSS_BUCKET_IS_NOT_ALLOWED_EMPTY);
        $options[self::OSS_BUCKET] = $bucket;
        $options[self::OSS_METHOD] = 'PUT';
        $options[self::OSS_OBJECT] = '/';
        $options[self::OSS_HEADERS] = array(self::OSS_ACL => $acl);
        $response = $this->auth($options);
        return $response;
    }