Exemplo n.º 1
0
 public function testGetHeader()
 {
     $response = new ResponseCore(array('key' => 'value'), "", 200);
     $result = new HeaderResult($response);
     $this->assertTrue($result->isOK());
     $this->assertTrue(is_array($result->getData()));
     $this->assertEquals($result->getData()['key'], 'value');
 }
Exemplo n.º 2
0
 /**
  * 获取Object的Meta信息
  *
  * @param string $bucket  bucket名称
  * @param string $object  object名称
  * @param string $options 具体参考SDK文档
  *
  * @return array
  */
 public function getObjectMeta($bucket, $object, $options = null)
 {
     $this->precheckCommon($bucket, $object, $options);
     $options[self::OSS_BUCKET] = $bucket;
     $options[self::OSS_METHOD] = self::OSS_HTTP_HEAD;
     $options[self::OSS_OBJECT] = $object;
     $response = $this->auth($options);
     $result = new HeaderResult($response);
     return $result->getData();
 }