public function set_object_meta($bucket, $object, $meta, $opt = array())
{
$this->assertParameterArray($opt);
$this->assertParameterArray($meta);
$opt[self::BUCKET] = $bucket;
$opt[self::OBJECT] = $object;
$opt[self::METHOD] = 'PUT';
//利用copy_object接口来设置meta信息
$source = "bs://{$bucket}{$object}";
if (empty($meta)) {
throw new BCS_Exception('$meta can not be empty! And $meta must be array.', -1);
}
foreach ($meta as $header => $value) {
self::set_header_into_opt($header, $value, $opt);
}
$source = array(self::BUCKET => $bucket, self::OBJECT => $object);
$response = $this->copy_object($source, $source, $opt);
$this->log($response->isOK() ? "Set object meta success!" : "Set object meta failed! Response: [" . $response->body . "]", $opt);
return $response;
}