當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。