Closed kesselb closed 5 years ago
Close #35
Credentials for s3 are provided by ec2 instance (https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_configuration.html#credentials).
With this pr its possible to pass $credentials and skip key and secret validation. To use the default s3 behaviour you could use something like this
key
secret
use Aws\Credentials\CredentialProvider; return [ 'class' => 'creocoder\flysystem\AwsS3Filesystem', 'credentials' => CredentialProvider::defaultProvider(), ];
Wrap defaultProvider in memoize for best performance
defaultProvider
memoize
use Aws\Credentials\CredentialProvider; return [ 'class' => 'creocoder\flysystem\AwsS3Filesystem', 'credentials' => CredentialProvider::memoize( CredentialProvider::defaultProvider() ), ];
@petrabarus @and186
This should be backward-compatible, right?
I think so, yes. When you pass key and secret and omit credentials (it's null by default) anything should be like before.
credentials
Thank you!
Close #35
Credentials for s3 are provided by ec2 instance (https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_configuration.html#credentials).
With this pr its possible to pass $credentials and skip
key
andsecret
validation. To use the default s3 behaviour you could use something like thisWrap
defaultProvider
inmemoize
for best performance@petrabarus @and186