/** * 解析WebsiteConfig数据 * * @return WebsiteConfig */ protected function parseDataFromResponse() { $content = $this->rawResponse->body; $config = new WebsiteConfig(); $config->parseFromXml($content); return $config; }
/** * 将bucket设置成静态网站托管模式 * * @param string $bucket bucket名称 * @param WebsiteConfig $websiteConfig * @param array $options 可以为空 * @throws OssException * @return null */ public function putBucketWebsite($bucket, $websiteConfig, $options = NULL) { $this->precheckCommon($bucket, NULL, $options, false); $options[self::OSS_BUCKET] = $bucket; $options[self::OSS_METHOD] = self::OSS_HTTP_PUT; $options[self::OSS_OBJECT] = '/'; $options[self::OSS_SUB_RESOURCE] = 'website'; $options[self::OSS_CONTENT_TYPE] = 'application/xml'; $options[self::OSS_CONTENT] = $websiteConfig->serializeToXml(); $response = $this->auth($options); $result = new PutSetDeleteResult($response); return $result->getData(); }