public function testBatchDeleteMoveCopy() { $key2 = 'testOp2' . getTid(); $key3 = 'testOp3' . getTid(); $key4 = 'testOp4' . getTid(); $e1 = new Qiniu_RS_EntryPath($this->bucket, $this->key); $e2 = new Qiniu_RS_EntryPath($this->bucket, $key2); $e3 = new Qiniu_RS_EntryPath($this->bucket, $key3); $e4 = new Qiniu_RS_EntryPath($this->bucket, $key4); Qiniu_RS_BatchDelete($this->client, array($e2, $e3, $e4)); $entryPairs = array(new Qiniu_RS_EntryPathPair($e1, $e2), new Qiniu_RS_EntryPathPair($e1, $e3)); list($ret, $err) = Qiniu_RS_BatchCopy($this->client, $entryPairs); $this->assertNull($err); $this->assertEquals($ret[0]['code'], 200); $this->assertEquals($ret[1]['code'], 200); list($ret, $err) = Qiniu_RS_BatchMove($this->client, array(new Qiniu_RS_EntryPathPair($e2, $e4))); $this->assertNull($err); $this->assertEquals($ret[0]['code'], 200); list($ret, $err) = Qiniu_RS_BatchDelete($this->client, array($e3, $e4)); $this->assertNull($err); $this->assertEquals($ret[0]['code'], 200); $this->assertEquals($ret[1]['code'], 200); Qiniu_RS_BatchDelete($this->client, array($e2, $e3, $e4)); }
var_dump($ret); } # @endgist # @gist batch_delete $entries = array($e1, $e2); list($ret, $err) = Qiniu_RS_BatchDelete($client, $entries); echo "\n\n====> Qiniu_RS_BatchDelete result: \n"; if ($err !== null) { var_dump($err); } else { var_dump($ret); } # @endgist # @gist batch_move $entryPairs = array(new Qiniu_RS_EntryPathPair($e3, $e1)); list($ret, $err) = Qiniu_RS_BatchMove($client, $entryPairs); echo "\n\n====> Qiniu_RS_BatchMove result: \n"; if ($err !== null) { var_dump($err); } else { var_dump($ret); } # @endgist //------------------------------------rsf----------------------------------------- list($iterms, $markerOut, $err) = Qiniu_RSF_ListPrefix($client, $bucket); echo "\n\n====> Qiniu_RSF result: \n"; if ($err != null) { if ($err === Qiniu_RSF_EOF) { var_dump($iterms); } else { var_dump(err);