Skip to content

Commit

Permalink
Merge branch 'flownative:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
christophlehmann authored Feb 9, 2022
2 parents 5bfcc7f + fcf44be commit 4f4dbf1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions Classes/Command/S3CommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public function listBucketsCommand(): void
} catch (\Exception $e) {
$this->outputLine($e->getMessage());
$this->quit(1);
exit;
}

if (count($result['Buckets']) === 0) {
Expand Down Expand Up @@ -144,7 +143,6 @@ public function flushBucketCommand(string $bucket): void
} catch (\Exception $e) {
$this->outputLine($e->getMessage());
$this->quit(1);
exit;
}
$promise->wait();
$this->outputLine('Successfully flushed bucket %s.', [$bucket]);
Expand Down
8 changes: 4 additions & 4 deletions Classes/S3Target.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function getKeyPrefix(): string
*/
public function getAcl()
{
return isset($this->acl) ? $this->acl : $this->defaultAcl;
return $this->acl ?? $this->defaultAcl;
}

/**
Expand Down Expand Up @@ -277,7 +277,7 @@ public function publishCollection(CollectionInterface $collection, callable $cal
if ($storage instanceof S3Storage) {
$this->publishCollectionFromS3Storage($collection, $storage, $potentiallyObsoleteObjects, $callback);
} else {
foreach ($collection->getObjects() as $object) {
foreach ($collection->getObjects($callback) as $object) {
/** @var StorageObject $object */
$this->publishFile($object->getStream(), $this->getRelativePublicationPathAndFilename($object), $object);
$objectName = $this->keyPrefix . $this->getRelativePublicationPathAndFilename($object);
Expand Down Expand Up @@ -413,7 +413,7 @@ private function copyObject(\Closure $sourceBuilder, \Closure $targetBuilder, Re
$this->systemLogger->debug(sprintf('Successfully published resource as object "%s" (SHA1: %s) by copying from "%s" to bucket "%s"', $target, $resource->getSha1() ?: 'unknown', $source, $this->bucketName));
} catch (S3Exception $e) {
$this->systemLogger->critical($e, LogEnvironment::fromMethodName(__METHOD__));
$message = sprintf('Could not publish resource with SHA1 hash %s of collection %s (source object: %s) through "CopyObject" because the S3 client reported an error: %s', $resource->getSha1(), $collection->getName(), $source, $e->getMessage());
$message = sprintf('Could not publish resource with SHA1 hash %s (source object: %s) through "CopyObject" because the S3 client reported an error: %s', $resource->getSha1(), $source, $e->getMessage());
$this->messageCollector->append($message);
}
}
Expand Down Expand Up @@ -514,7 +514,7 @@ protected function publishFile($sourceStream, string $relativeTargetPathAndFilen
];

try {
$this->s3Client->upload($this->bucketName, $objectName, $sourceStream, $this->getAcl() ? $this->getAcl() : null, $options);
$this->s3Client->upload($this->bucketName, $objectName, $sourceStream, $this->getAcl() ?: null, $options);
$this->systemLogger->debug(sprintf('Successfully published resource as object "%s" in bucket "%s" with SHA1 hash "%s"', $objectName, $this->bucketName, $metaData->getSha1() ?: 'unknown'));
} catch (\Exception $e) {
$this->systemLogger->debug(sprintf('Failed publishing resource as object "%s" in bucket "%s" with SHA1 hash "%s": %s', $objectName, $this->bucketName, $metaData->getSha1() ?: 'unknown', $e->getMessage()));
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"MIT"
],
"require": {
"neos/flow": "^7.0 || dev-master",
"aws/aws-sdk-php": "~3.0"
"neos/flow": "^6.3 || ^7.0 || dev-master",
"aws/aws-sdk-php": "^3.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 4f4dbf1

Please sign in to comment.