Skip to content

Commit

Permalink
Merge pull request #524 from luchidalgo/main
Browse files Browse the repository at this point in the history
Add use_aws_shared_config_files option to fm_elfinder configuration
  • Loading branch information
helios-ag committed Jan 4, 2024
2 parents 49a5317 + 1b594ca commit 5f048ae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/configuration-dump.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ fm_elfinder:
optional_prefix: ''
endpoint: ''
use_path_style_endpoint: false
use_aws_shared_config_files: true
options:
enabled: false
ACL: ''
Expand Down
2 changes: 2 additions & 0 deletions docs/flysystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ Define the variables in your config.yml or set it directly.
If you don't use subdomain that contains your `bucket_name` and want to use your own **endpoint** make sure to set **use_path_style_endpoint** to `true` so that it will format the url correctly.

To prevent AWS PHP SDK from verifying the presence of a shared configuration in .aws/configuration make sure to set **use_aws_shared_config_files** to `false`.

Also possible to define Flysystem adapters as services, it can be useful for self written adapters.
To use adapter as service, define it under 'services' node in your services.yml (or use DI)

Expand Down
9 changes: 5 additions & 4 deletions src/Configuration/ElFinderConfigurationReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,11 @@ private function configureFlysystem($opt, $adapter, $serviceName)
break;
case 'aws_s3_v3':
$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'],
'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'],
'use_aws_shared_config_files' => $opt['aws_s3_v3']['use_aws_shared_config_files'],
];

if (!empty($opt['aws_s3_v3']['key']) && !empty($opt['aws_s3_v3']['secret'])) {
Expand Down
1 change: 1 addition & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ private function createFlysystemNode()
->scalarNode('optional_prefix')->defaultvalue('')->end()
->scalarNode('endpoint')->defaultNull()->end()
->booleanNode('use_path_style_endpoint')->defaultFalse()->end()
->booleanNode('use_aws_shared_config_files')->defaultTrue()->end()
->arrayNode('options')
->canBeEnabled()
->children()
Expand Down

0 comments on commit 5f048ae

Please sign in to comment.