barryvdh / elfinder-flysystem-driver

elFinder driver for Flysystem
183 stars 41 forks source link

Filesystem cache wrapping now accepts original filesystem config #75

Closed grossmannmartin closed 4 years ago

grossmannmartin commented 5 years ago

closes #73

Considering following filesystem configuration:

// ... configuration
$s3Adapter = new AwsS3Adapter($s3Client, $bucketName);

return new Filesystem($s3Adapter, [
    'visibility' => AdapterInterface::VISIBILITY_PUBLIC,
]); 

When filesystem is mounted, it's wrapped into CachedAdapter (because AwsS3Adapter is not the descendant of League\Flysystem\Cached\CachedAdapter) in Driver::init() method.

In this method, property $fs is replaced: $this->fs = new Filesystem($adapter);. But this effectively drops the "visibility" configuration.

Proposed change add original filesystem configuration into newly created filesystem.