buildBatchDelete() 공개 정적인 메소드

public static buildBatchDelete ( $bucket, $keys )
예제 #1
0
파일: BucketTest.php 프로젝트: miecu/YouPan
 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']);
 }
예제 #2
0
 /**
  * @inheritdoc
  */
 public function deleteDir($dirname)
 {
     // 七牛无目录概念. 目前实现方案是.列举指定目录资源.批量删除
     $keys = array_map(function ($file) {
         return $file['key'];
     }, $this->listDirContents($dirname));
     list(, $err) = $this->getBucketManager()->batch(BucketManager::buildBatchDelete($keys));
     return $err === null;
 }