当前位置: 首页>>代码示例>>PHP>>正文


PHP S3Client::deleteObjects方法代码示例

本文整理汇总了PHP中Aws\S3\S3Client::deleteObjects方法的典型用法代码示例。如果您正苦于以下问题:PHP S3Client::deleteObjects方法的具体用法?PHP S3Client::deleteObjects怎么用?PHP S3Client::deleteObjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Aws\S3\S3Client的用法示例。


在下文中一共展示了S3Client::deleteObjects方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deleteObjects

 /**
  * This operation enables you to delete multiple objects from a bucket using a single HTTP request.
  * You may specify up to 1000 keys.
  *
  * @param string $bucket
  * @param array  $objects
  *
  * @return mixed
  */
 public function deleteObjects($bucket, array $objects)
 {
     $params = ['Bucket' => $bucket, 'Objects' => []];
     foreach ($objects as $object) {
         $objects[] = ['Key' => $object];
     }
     return $this->instance->deleteObjects($params);
 }
开发者ID:Webiny,项目名称:Framework,代码行数:17,代码来源:S3.php

示例2: bulkDelete

 /**
  * @param array $files
  */
 public function bulkDelete(array $files)
 {
     $objects = [];
     foreach ($files as $filePath) {
         $objects[] = ['Key' => Utils::normalizePath($this->relativePath . '/' . $filePath)];
     }
     $this->s3Client->deleteObjects(['Bucket' => $this->basePath, 'Delete' => ['Objects' => $objects]]);
 }
开发者ID:ondrs,项目名称:upload-manager,代码行数:11,代码来源:S3Storage.php

示例3: delete

 /**
  * @param $files
  * @return mixed
  */
 public function delete($files)
 {
     $result['status'] = false;
     $objects = [];
     foreach ($files as $fileKey) {
         $objects[] = $fileKey;
     }
     try {
         $deleteResult = $this->s3->deleteObjects(['Bucket' => $this->bucket, 'Delete' => ['Objects' => $objects]]);
         $result['status'] = true;
         $result['data'] = $deleteResult;
     } catch (S3Exception $e) {
         echo $e . "\nThere was an error uploading the file.\n";
     }
     return $result;
 }
开发者ID:evneandreys,项目名称:yii2-filemanager,代码行数:20,代码来源:S3.php

示例4: rmdir

 public function rmdir($path)
 {
     $path = $this->normalizePath($path);
     if (!$this->file_exists($path)) {
         return false;
     }
     // Since there are no real directories on S3, we need
     // to delete all objects prefixed with the path.
     $objects = $this->connection->listObjects(array('Bucket' => $this->bucket, 'Prefix' => $path . '/'));
     try {
         $result = $this->connection->deleteObjects(array('Bucket' => $this->bucket, 'Objects' => $objects['Contents']));
         $this->testTimeout();
     } catch (S3Exception $e) {
         \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR);
         return false;
     }
     return true;
 }
开发者ID:Combustible,项目名称:core,代码行数:18,代码来源:amazons3.php

示例5: remove

 /**
  * Remove an attached file.
  *
  * @param array $filePaths
  */
 public function remove(array $filePaths)
 {
     if ($filePaths) {
         $this->s3Client->deleteObjects(['Bucket' => $this->attachedFile->s3_object_config['Bucket'], 'Delete' => ['Objects' => $this->getKeys($filePaths)]]);
     }
 }
开发者ID:a7madev,项目名称:stapler,代码行数:11,代码来源:S3.php


注:本文中的Aws\S3\S3Client::deleteObjects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。