← All changes
|
includes/sdk/s3/Aws/Multipart/AbstractUploadManager.php
+7
-2
1.2.13
→
1.4.2
View file →
| @@ -32,8 +32,10 @@ | ||
| 32 | 32 | /** @var PromiseInterface Promise that represents the multipart upload. */ |
| 33 | 33 | protected $promise; |
| 34 | 34 | /** @var UploadState State used to manage the upload. */ |
| 35 | 35 | protected $state; |
| 36 | + /** @var bool Configuration used to indicate if upload progress will be displayed. */ | |
| 37 | + protected $displayProgress; | |
| 36 | 38 | /** |
| 37 | 39 | * @param Client $client |
| 38 | 40 | * @param array $config |
| 39 | 41 | */ |
| @@ -42,8 +44,11 @@ | ||
| 42 | 44 | $this->client = $client; |
| 43 | 45 | $this->info = $this->loadUploadWorkflowInfo(); |
| 44 | 46 | $this->config = $config + self::$defaultConfig; |
| 45 | 47 | $this->state = $this->determineState(); |
| 48 | + if (isset($config['display_progress']) && \is_bool($config['display_progress'])) { | |
| 49 | + $this->displayProgress = $config['display_progress']; | |
| 50 | + } | |
| 46 | 51 | } |
| 47 | 52 | /** |
| 48 | 53 | * Returns the current state of the upload |
| 49 | 54 | * |
| @@ -185,9 +190,9 @@ | ||
| 185 | 190 | throw new IAE('You must provide a value for "' . $key . '" in ' . 'your config for the MultipartUploader for ' . $this->client->getApi()->getServiceFullName() . '.'); |
| 186 | 191 | } |
| 187 | 192 | $id[$param] = $this->config[$key]; |
| 188 | 193 | } |
| 189 | - $state = new UploadState($id); | |
| 194 | + $state = new UploadState($id, $this->config); | |
| 190 | 195 | $state->setPartSize($this->determinePartSize()); |
| 191 | 196 | return $state; |
| 192 | 197 | } |
| 193 | 198 | /** |
| @@ -224,9 +229,9 @@ | ||
| 224 | 229 | */ |
| 225 | 230 | protected function getResultHandler(&$errors = []) |
| 226 | 231 | { |
| 227 | 232 | return function (callable $handler) use(&$errors) { |
| 228 | - return function (CommandInterface $command, RequestInterface $request = null) use($handler, &$errors) { | |
| 233 | + return function (CommandInterface $command, ?RequestInterface $request = null) use($handler, &$errors) { | |
| 229 | 234 | return $handler($command, $request)->then(function (ResultInterface $result) use($command) { |
| 230 | 235 | $this->handleResult($command, $result); |
| 231 | 236 | return $result; |
| 232 | 237 | }, function (AwsException $e) use(&$errors) { |