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


PHP S3Client::getPaginator方法代码示例

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


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

示例1: retrievePaginatedListing

 /**
  * @param array $options
  *
  * @return array
  */
 protected function retrievePaginatedListing(array $options)
 {
     $resultPaginator = $this->s3Client->getPaginator('ListObjects', $options);
     $listing = [];
     foreach ($resultPaginator as $result) {
         $listing = array_merge($listing, $result->get('Contents') ?: [], $result->get('CommonPrefixes') ?: []);
     }
     return $listing;
 }
开发者ID:twistor,项目名称:flysystem-aws-s3-v3,代码行数:14,代码来源:AwsS3Adapter.php

示例2: getStateFromService

 /**
  * Creates an UploadState object for a multipart upload by querying the
  * service for the specified upload's information.
  *
  * @param S3Client $client   S3Client used for the upload.
  * @param string   $bucket   Bucket for the multipart upload.
  * @param string   $key      Object key for the multipart upload.
  * @param string   $uploadId Upload ID for the multipart upload.
  *
  * @return UploadState
  */
 public static function getStateFromService(S3Client $client, $bucket, $key, $uploadId)
 {
     $state = new UploadState(['Bucket' => $bucket, 'Key' => $key, 'UploadId' => $uploadId]);
     foreach ($client->getPaginator('ListParts', $state->getId()) as $result) {
         // Get the part size from the first part in the first result.
         if (!$state->getPartSize()) {
             $state->setPartSize($result->search('Parts[0].Size'));
         }
         // Mark all the parts returned by ListParts as uploaded.
         foreach ($result['Parts'] as $part) {
             $state->markPartAsUploaded($part['PartNumber'], ['PartNumber' => $part['PartNumber'], 'ETag' => $part['ETag']]);
         }
     }
     $state->setStatus(UploadState::INITIATED);
     return $state;
 }
开发者ID:Cinemacloud,项目名称:angular-moviemasher,代码行数:27,代码来源:MultipartUploader.php


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