Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reusing the registered S3 protocol with different options #6

Open
ghost opened this issue Jul 31, 2012 · 0 comments
Open

Reusing the registered S3 protocol with different options #6

ghost opened this issue Jul 31, 2012 · 0 comments

Comments

@ghost
Copy link

ghost commented Jul 31, 2012

Hi,

We have an application that needs to reuse the registered S3 protocol, but with differing S3 credentials and options at difference stages.

So, we have changed the code around line 140 of the main aS3StreamWrapper.class.php

if ( !isset( self::$protocolOptions[$protocol] ) ) {
    stream_wrapper_register($protocol, get_class($this));
}
self::$protocolOptions[$protocol] = $options;

this prevents a PHP fatal error for the existing S3 protocol registration and updates the options to be used on the protocol. A clearer approach would be a public "update options" method. But this works with minimal changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants