From b78d6dab194ed89bf83b70340193adeeb250968c Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Thu, 3 Feb 2022 15:41:46 +0100 Subject: [PATCH] Remove duplicate else Seems to occured during merge --- Classes/S3Target.php | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/Classes/S3Target.php b/Classes/S3Target.php index 09e9ea4..17608bb 100644 --- a/Classes/S3Target.php +++ b/Classes/S3Target.php @@ -276,34 +276,6 @@ public function publishCollection(CollectionInterface $collection, callable $cal if ($storage instanceof S3Storage) { $this->publishCollectionFromS3Storage($collection, $storage, $potentiallyObsoleteObjects, $callback); - } else { - foreach ($collection->getObjects($callback) as $object) { - /** @var StorageObject $object */ - $objectName = $this->keyPrefix . $this->getRelativePublicationPathAndFilename($object); - if (array_key_exists($objectName, $potentiallyObsoleteObjects)) { - $this->systemLogger->debug(sprintf('The resource object "%s" (SHA1: %s) has already been published to bucket "%s", no need to re-publish', $objectName, $object->getSha1() ?: 'unknown', $this->bucketName)); - $potentiallyObsoleteObjects[$objectName] = false; - } else { - $options = [ - 'Bucket' => $this->bucketName, - 'CopySource' => urlencode($storageBucketName . '/' . $storage->getKeyPrefix() . $object->getSha1()), - 'ContentType' => $object->getMediaType(), - 'MetadataDirective' => 'REPLACE', - 'Key' => $objectName - ]; - if ($this->getAcl()) { - $options['ACL'] = $this->getAcl(); - } - try { - $this->s3Client->copyObject($options); - $this->systemLogger->debug(sprintf('Successfully copied resource as object "%s" (SHA1: %s) from bucket "%s" to bucket "%s"', $objectName, $object->getSha1() ?: 'unknown', $storageBucketName, $this->bucketName)); - } catch (S3Exception $e) { - $message = sprintf('Could not copy resource with SHA1 hash %s of collection %s from bucket %s to %s: %s', $object->getSha1(), $collection->getName(), $storageBucketName, $this->bucketName, $e->getMessage()); - $this->systemLogger->critical($e, LogEnvironment::fromMethodName(__METHOD__)); - $this->messageCollector->append($message); - } - } - } } else { foreach ($collection->getObjects() as $object) { /** @var StorageObject $object */