diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5275886..2574f6c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -33,6 +33,7 @@ jobs: - name: 'Install project dependencies' run: | + composer global config --no-plugins allow-plugins.symfony/flex true composer global require --no-progress --no-scripts --no-plugins symfony/flex composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable vendor/bin/simple-phpunit install diff --git a/src/Configuration/ElFinderConfigurationReader.php b/src/Configuration/ElFinderConfigurationReader.php index 582d984..15278df 100644 --- a/src/Configuration/ElFinderConfigurationReader.php +++ b/src/Configuration/ElFinderConfigurationReader.php @@ -232,16 +232,19 @@ private function configureFlysystem($opt, $adapter, $serviceName) break; case 'aws_s3_v3': - $client = new S3Client([ - 'credentials' => [ - 'key' => $opt['aws_s3_v3']['key'], - 'secret' => $opt['aws_s3_v3']['secret'], - ], + $s3Options = [ 'region' => $opt['aws_s3_v3']['region'], 'version' => $opt['aws_s3_v3']['version'], 'endpoint' => $opt['aws_s3_v3']['endpoint'], 'use_path_style_endpoint' => $opt['aws_s3_v3']['use_path_style_endpoint'], - ]); + ]; + if (!empty($opt['aws_s3_v3']['key']) && !empty($opt['aws_s3_v3']['secret'])) { + $s3Options['credentials'] = [ + 'key' => $opt['aws_s3_v3']['key'], + 'secret' => $opt['aws_s3_v3']['secret'], + ]; + } + $client = new S3Client($s3Options); $filesystem = new Filesystem(new AwsS3v3($client, $opt['aws_s3_v3']['bucket_name'], $opt['aws_s3_v3']['optional_prefix'], null, null, $opt['aws_s3_v3']['options'])); break;