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.