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


PHP S3Client::deleteMatchingObjects方法代码示例

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


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

示例1: remove

 /**
  * {@inheritDoc}
  */
 public function remove(array $paths, array $filters)
 {
     if (empty($paths) && empty($filters)) {
         return;
     }
     if (empty($paths)) {
         try {
             $this->storage->deleteMatchingObjects($this->bucket, null, sprintf('/%s/i', implode('|', $filters)));
         } catch (\Exception $e) {
             $this->logError('The objects could not be deleted from Amazon S3.', array('filter' => implode(', ', $filters), 'bucket' => $this->bucket, 'exception' => $e));
         }
         return;
     }
     foreach ($filters as $filter) {
         foreach ($paths as $path) {
             $objectPath = $this->getObjectPath($path, $filter);
             if (!$this->objectExists($objectPath)) {
                 continue;
             }
             try {
                 $this->storage->deleteObject(array('Bucket' => $this->bucket, 'Key' => $objectPath));
             } catch (\Exception $e) {
                 $this->logError('The object could not be deleted from Amazon S3.', array('objectPath' => $objectPath, 'filter' => $filter, 'bucket' => $this->bucket, 'exception' => $e));
             }
         }
     }
 }
开发者ID:sanchojaf,项目名称:oldmytriptocuba,代码行数:30,代码来源:AwsS3Resolver.php

示例2: deleteDir

 /**
  * Delete a directory.
  *
  * @param string $dirname
  *
  * @return bool
  */
 public function deleteDir($dirname)
 {
     try {
         $prefix = $this->applyPathPrefix($dirname) . '/';
         $this->s3Client->deleteMatchingObjects($this->bucket, $prefix);
     } catch (DeleteMultipleObjectsException $exception) {
         return false;
     }
     return true;
 }
开发者ID:janhartigan,项目名称:flysystem-aws-s3-v3,代码行数:17,代码来源:AwsS3Adapter.php

示例3: deleteFolder

 /**
  * Delete Folder
  *
  * @param string $folder Path folder
  *
  * @return bool
  * @throws
  */
 public function deleteFolder($folder)
 {
     $folder = trim($folder, '/') . '/';
     // Fail if this pseudo directory key already exists
     if (!$this->isDir($folder)) {
         $path = $this->bucket . "/" . $folder;
         throw new ExceptionStorage("Directory {$path} Not found or Not Is Diretory", static::E_NOT_IS_DIR);
     }
     return (bool) $this->clientS3->deleteMatchingObjects($this->bucket, $folder);
 }
开发者ID:naturalweb,项目名称:filestorage,代码行数:18,代码来源:S3Storage.php

示例4: deleteMatchingObjects

 /**
  * Deletes objects from Amazon S3 that match the result of a ListObjects operation. For example, this allows you
  * to do things like delete all objects that match a specific key prefix.
  *
  * @param string $bucket Bucket that contains the object keys
  * @param string $prefix Optionally delete only objects under this key prefix
  * @param string $regex Delete only objects that match this regex
  * @param array  $options Options used when deleting the object:
  *                        - before_delete: Callback to invoke before each delete. The callback will receive a
  *                        Guzzle\Common\Event object with context.
  *
  * @see Aws\S3\S3Client::listObjects
  * @see Aws\S3\Model\ClearBucket For more options or customization
  * @return int Returns the number of deleted keys
  * @throws \RuntimeException if no prefix and no regex is given
  */
 public function deleteMatchingObjects($bucket, $prefix = '', $regex = '', array $options = [])
 {
     return $this->instance->deleteMatchingObjects($bucket, $prefix, $regex, $options);
 }
开发者ID:Webiny,项目名称:Framework,代码行数:20,代码来源:S3.php

示例5: deleteDir

 /**
  * Delete a directory (recursive)
  *
  * @param   string   $path
  * @return  boolean  delete result
  */
 public function deleteDir($path)
 {
     return $this->client->deleteMatchingObjects($this->bucket, $this->prefix($path));
 }
开发者ID:luoshulin,项目名称:falcon,代码行数:10,代码来源:AwsS3.php

示例6: deleteMatchingObjects

 /**
  * deleteMatchingObjects
  *
  * @param string $prefix
  * @param string $regex
  * @param array  $options
  *
  * @return integer
  */
 public function deleteMatchingObjects($prefix = '', $regex = '', array $options = array())
 {
     return $this->client->deleteMatchingObjects($this->name, $prefix, $regex, $options);
 }
开发者ID:m6web,项目名称:aws-bundle,代码行数:13,代码来源:Bucket.php

示例7: deleteDir

 /**
  * Delete a directory (recursive)
  *
  * @param   string   $path
  * @return  boolean  delete result
  */
 public function deleteDir($path)
 {
     $prefix = rtrim($this->prefix($path), '/') . '/';
     return $this->client->deleteMatchingObjects($this->bucket, $prefix);
 }
开发者ID:xamiro-dev,项目名称:xamiro,代码行数:11,代码来源:AwsS3.php


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