Loading inc/class-s3-uploads-stream-wrapper.php +13 −2 Original line number Diff line number Diff line Loading @@ -2,14 +2,25 @@ class S3_Uploads_Stream_Wrapper extends Aws\S3\StreamWrapper { protected static $s3_uploads; public function __construct() { static::$client = static::$s3_uploads->s3(); } /** * Register the 's3://' stream wrapper * * @param S3Client $client Client to use with the stream wrapper */ public static function register( Aws\S3\S3Client $client) { public static function register_streamwrapper( $s3_uploads ) { static::$s3_uploads = $s3_uploads; if ( in_array( 's3', stream_get_wrappers() ) ) { stream_wrapper_unregister( 's3' ); } stream_wrapper_register( 's3', __CLASS__, STREAM_IS_URL ); static::$client = $client; } // Override Loading inc/class-s3-uploads.php +5 −6 Original line number Diff line number Diff line Loading @@ -70,8 +70,10 @@ class S3_Uploads { require_once dirname( __FILE__ ) . '/class-s3-uploads-local-stream-wrapper.php'; stream_wrapper_register( 's3', 'S3_Uploads_Local_Stream_Wrapper', STREAM_IS_URL ); } else { $s3 = $this->s3(); S3_Uploads_Stream_Wrapper::register( $s3 ); require_once dirname( dirname( __FILE__ ) ) . '/lib/aws-sdk/aws-autoloader.php'; require_once dirname( __FILE__ ) . '/class-s3-uploads-stream-wrapper.php'; S3_Uploads_Stream_Wrapper::register_streamwrapper( $this ); stream_context_set_option( stream_context_get_default(), 's3', 'ACL', 'public-read' ); } Loading Loading @@ -124,9 +126,6 @@ class S3_Uploads { */ public function s3() { require_once dirname( dirname( __FILE__ ) ) . '/lib/aws-sdk/aws-autoloader.php'; require_once dirname( __FILE__ ). '/class-s3-uploads-stream-wrapper.php'; if ( ! empty( $this->s3 ) ) return $this->s3; Loading Loading
inc/class-s3-uploads-stream-wrapper.php +13 −2 Original line number Diff line number Diff line Loading @@ -2,14 +2,25 @@ class S3_Uploads_Stream_Wrapper extends Aws\S3\StreamWrapper { protected static $s3_uploads; public function __construct() { static::$client = static::$s3_uploads->s3(); } /** * Register the 's3://' stream wrapper * * @param S3Client $client Client to use with the stream wrapper */ public static function register( Aws\S3\S3Client $client) { public static function register_streamwrapper( $s3_uploads ) { static::$s3_uploads = $s3_uploads; if ( in_array( 's3', stream_get_wrappers() ) ) { stream_wrapper_unregister( 's3' ); } stream_wrapper_register( 's3', __CLASS__, STREAM_IS_URL ); static::$client = $client; } // Override Loading
inc/class-s3-uploads.php +5 −6 Original line number Diff line number Diff line Loading @@ -70,8 +70,10 @@ class S3_Uploads { require_once dirname( __FILE__ ) . '/class-s3-uploads-local-stream-wrapper.php'; stream_wrapper_register( 's3', 'S3_Uploads_Local_Stream_Wrapper', STREAM_IS_URL ); } else { $s3 = $this->s3(); S3_Uploads_Stream_Wrapper::register( $s3 ); require_once dirname( dirname( __FILE__ ) ) . '/lib/aws-sdk/aws-autoloader.php'; require_once dirname( __FILE__ ) . '/class-s3-uploads-stream-wrapper.php'; S3_Uploads_Stream_Wrapper::register_streamwrapper( $this ); stream_context_set_option( stream_context_get_default(), 's3', 'ACL', 'public-read' ); } Loading Loading @@ -124,9 +126,6 @@ class S3_Uploads { */ public function s3() { require_once dirname( dirname( __FILE__ ) ) . '/lib/aws-sdk/aws-autoloader.php'; require_once dirname( __FILE__ ). '/class-s3-uploads-stream-wrapper.php'; if ( ! empty( $this->s3 ) ) return $this->s3; Loading