本文整理汇总了PHP中Aws\S3\S3Client::listParts方法的典型用法代码示例。如果您正苦于以下问题:PHP S3Client::listParts方法的具体用法?PHP S3Client::listParts怎么用?PHP S3Client::listParts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aws\S3\S3Client
的用法示例。
在下文中一共展示了S3Client::listParts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listParts
/**
* listParts
*
* @param string $key
* @param string $uploadId
* @param integer $maxParts
* @param integer $maxNumberMarker
*
* @return \Guzzle\Service\Resource\Model
*/
public function listParts($key, $uploadId, $maxParts = null, $maxNumberMarker = null)
{
$params = ['Bucket' => $this->name, 'Key' => $key, 'UploadId' => $uploadId];
if (!is_null($maxParts)) {
$params['MaxParts'] = $maxParts;
}
if (!is_null($maxNumberMarker)) {
$params['MaxNumberMarker'] = $maxNumberMarker;
}
return $this->client->listParts($params);
}
示例2: listParts
/**
* Calling `$this->s3->listParts($fileoptions);` is okay in general unless there are more than 1000 parts - amazon will only send back the manifest for 1000 parts at a time
* With a chuink size of 5mb the file only needs to be >5GB for this to happen.
* We call the function recursively to fetch the next set of parts until we have them all.
*
* @param array $fileoptions
* @return array
*/
private function listParts($fileoptions)
{
$parts = $this->s3->listParts($fileoptions);
$fileoptions['PartNumberMarker'] = $parts['NextPartNumberMarker'];
return $parts['IsTruncated'] ? array_merge($parts['Parts'], $this->listParts($fileoptions)) : $parts['Parts'];
}