Qiniu\Storage\BucketManager::buildBatchCopy PHP Method

buildBatchCopy() public static method

public static buildBatchCopy ( $source_bucket, $key_pairs, $target_bucket )
    public static function buildBatchCopy($source_bucket, $key_pairs, $target_bucket)
    {
        return self::twoKeyBatch('copy', $source_bucket, $key_pairs, $target_bucket);
    }

Usage Example

示例#1
0
 public function testBatchCopy()
 {
     $key = 'copyto' . rand();
     $ops = BucketManager::buildBatchCopy($this->bucketName, array($this->key => $key), $this->bucketName);
     list($ret, $error) = $this->bucketManager->batch($ops);
     $this->assertEquals(200, $ret[0]['code']);
     $ops = BucketManager::buildBatchDelete($this->bucketName, array($key));
     list($ret, $error) = $this->bucketManager->batch($ops);
     $this->assertEquals(200, $ret[0]['code']);
 }