Example #1
0
 private function fileUrl()
 {
     $func = new Functions();
     $url = $this->host . '/mkfile/' . $this->size;
     $url .= '/mimeType/' . $func->base64_urlSafeEncode($this->mime);
     if ($this->key != null) {
         $url .= '/key/' . $func->base64_urlSafeEncode($this->key);
     }
     if (!empty($this->params)) {
         foreach ($this->params as $key => $value) {
             $val = $func->base64_urlSafeEncode($value);
             $url .= "/{$key}/{$val}";
         }
     }
     return $url;
 }
Example #2
0
 private static function twoKeyBatch($operation, $source_bucket, $key_pairs, $target_bucket)
 {
     if ($target_bucket == null) {
         $target_bucket = $source_bucket;
     }
     $data = array();
     $func = new Functions();
     foreach ($key_pairs as $from_key => $to_key) {
         $from = $func->entry($source_bucket, $from_key);
         $to = $func->entry($target_bucket, $to_key);
         array_push($data, $operation . '/' . $from . '/' . $to);
     }
     return $data;
 }