public function exportFiles($offset = 0, $count = 100)
{
$files = [];
if (empty($this->objects)) {
$this->objects = $this->client->listObjects(['Bucket' => $this->getBucket(), 'MaxKeys' => $count]);
} else {
$this->objects = $this->client->listObjects(['Bucket' => $this->getBucket(), 'MaxKeys' => $count, 'Marker' => $this->objects[count($this->objects) - 1]]);
}
if (empty($this->objects)) {
return false;
}
foreach ($this->objects as $object) {
if (isset($object['Contents']) && substr($object['Contents'], -1) != '/') {
$content = $this->client->getObject(['Bucket' => $this->getBucket(), 'Key' => $object['Key']]);
if (isset($content['Body'])) {
$files[] = ['filename' => $object['Key'], 'content' => (string) $content['Body']];
}
}
}
return $files;
}