| @@ 196-214 (lines=19) @@ | ||
| 193 | /** |
|
| 194 | * {@inheritdoc} |
|
| 195 | */ |
|
| 196 | public function listKeys($prefix = '') |
|
| 197 | { |
|
| 198 | $this->ensureBucketExists(); |
|
| 199 | ||
| 200 | $options = ['Bucket' => $this->bucket]; |
|
| 201 | if ((string) $prefix != '') { |
|
| 202 | $options['Prefix'] = $this->computePath($prefix); |
|
| 203 | } elseif (!empty($this->options['directory'])) { |
|
| 204 | $options['Prefix'] = $this->options['directory']; |
|
| 205 | } |
|
| 206 | ||
| 207 | $keys = []; |
|
| 208 | $iter = $this->service->getIterator('ListObjects', $options); |
|
| 209 | foreach ($iter as $file) { |
|
| 210 | $keys[] = $this->computeKey($file['Key']); |
|
| 211 | } |
|
| 212 | ||
| 213 | return $keys; |
|
| 214 | } |
|
| 215 | ||
| 216 | /** |
|
| 217 | * {@inheritdoc} |
|
| @@ 210-228 (lines=19) @@ | ||
| 207 | /** |
|
| 208 | * {@inheritdoc} |
|
| 209 | */ |
|
| 210 | public function listKeys($prefix = '') |
|
| 211 | { |
|
| 212 | $this->ensureBucketExists(); |
|
| 213 | ||
| 214 | $options = ['Bucket' => $this->bucket]; |
|
| 215 | if ((string) $prefix != '') { |
|
| 216 | $options['Prefix'] = $this->computePath($prefix); |
|
| 217 | } elseif (!empty($this->options['directory'])) { |
|
| 218 | $options['Prefix'] = $this->options['directory']; |
|
| 219 | } |
|
| 220 | ||
| 221 | $keys = []; |
|
| 222 | $result = $this->service->listObjectsV2($options); |
|
| 223 | foreach ($result->getContents() as $file) { |
|
| 224 | $keys[] = $this->computeKey($file->getKey()); |
|
| 225 | } |
|
| 226 | ||
| 227 | return $keys; |
|
| 228 | } |
|
| 229 | ||
| 230 | /** |
|
| 231 | * {@inheritdoc} |
|