Skip to content

Reusing the registered S3 protocol with different options #6

@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions