Skip to content

Commit

Permalink
Added async config parameter to use async S3 adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
ozahorulia committed Feb 19, 2023
1 parent 4dffbea commit 415ee90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DependencyInjection/SonataMediaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ public function configureFilesystemAdapter(ContainerBuilder $container, array $c
if ($container->hasDefinition('sonata.media.adapter.filesystem.s3') && isset($config['filesystem']['s3'])) {
$async = true === $config['filesystem']['s3']['async'];
if (true === $async && !class_exists(SimpleS3Client::class)) {
throw new \RuntimeException('You must install "async-aws/simple-s3" to use async adapter');
throw new \RuntimeException('You must install "async-aws/simple-s3" to use async S3 adapter');
} elseif (false === $async && !class_exists(S3Client::class)) {
throw new \RuntimeException('You must install "aws/aws-sdk-php" to use async adapter');
throw new \RuntimeException('You must install "aws/aws-sdk-php" to use Amazon S3 filesystem');
}

$adapterClass = $async ? AsyncAwsS3::class : AwsS3::class;
Expand Down

0 comments on commit 415ee90

Please sign in to comment.