Skip to content

Commit 0603fbe

Browse files
committed
1 parent b778086 commit 0603fbe

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

inc/class-local-stream-wrapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ public function url_stat( $uri, $flags ) {
512512
*/
513513
public function dir_opendir( $uri, $options ) {
514514
$this->uri = $uri;
515-
$this->handle = opendir( $this->getLocalPath() );
515+
$this->handle = opendir( pathinfo($this->getLocalPath(), PATHINFO_DIRNAME) );
516516

517517
return (bool) $this->handle;
518518
}

inc/class-plugin.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Aws;
66
use Exception;
77
use WP_Error;
8+
use S3_Uploads\Local_Stream_Wrapper;
89

910
/**
1011
* @psalm-consistent-constructor
@@ -144,9 +145,9 @@ public function tear_down() {
144145
*/
145146
public function register_stream_wrapper() {
146147
if ( defined( 'S3_UPLOADS_USE_LOCAL' ) && S3_UPLOADS_USE_LOCAL ) {
147-
stream_wrapper_register( 's3', 'S3_Uploads\Local_Stream_Wrapper', STREAM_IS_URL );
148+
stream_wrapper_register( 's3', Local_Stream_Wrapper::class, STREAM_IS_URL );
148149
} else {
149-
Stream_Wrapper::register( $this );
150+
Stream_Wrapper::register( $this, 's3', new Cache_Layer() );
150151
$acl = defined( 'S3_UPLOADS_OBJECT_ACL' ) ? S3_UPLOADS_OBJECT_ACL : 'public-read';
151152
stream_context_set_option( stream_context_get_default(), 's3', 'ACL', $acl );
152153
}

0 commit comments

Comments
 (0)