Exemplo n.º 1
0
 /**
  * func BatchGet(params array) => (result array, code int, err Error)
  * 批量下载授权(生成一堆短期有效的可匿名下载URL)
  * paramsarray 的元素可以是两种情况:1. string 类型。表示 key 2. array 类型。要求是:array('key' => $key, 'attName' => $attName, 'expires' => 3600),其中 'attName'、'expires' 为可选。
  * result 是一个这样 {code, GetRet} 的数组
  */
 public function BatchGet(array $params)
 {
     $ops = "";
     foreach ($params as $obj) {
         if (!empty($ops)) {
             $ops = $ops . '&';
         }
         if (is_string(array_shift($params))) {
             $entryURI = $this->Bucket . ':' . $obj;
             $ops = $ops . 'op=/get/' . QBox_Encode($entryURI);
         } else {
             $entryURI = $this->Bucket . ':' . $obj['key'];
             $ops = $ops . 'op=/get/' . QBox_Encode($entryURI);
             if (!empty($obj['attName'])) {
                 $ops = $ops . '/attName/' . QBox_Encode($obj['attName']);
             }
             if (!empty($obj["expires"])) {
                 $ops = $ops . '/expires/' . $obj["expires"];
             }
         }
     }
     $url = QBOX_RS_HOST . '/batch';
     return QBox_OAuth2_CallWithParams($this->Conn, $url, $ops);
 }
Exemplo n.º 2
0
 public function GetWatermark($customer)
 {
     $url = QBOX_EU_HOST . '/wmget';
     $params = array('customer' => $customer);
     return QBox_OAuth2_CallWithParams($this->Conn, $url, $params);
 }