barryvdh / elfinder-flysystem-driver

elFinder driver for Flysystem
183 stars 41 forks source link

No fallback config for cache filesystem #73

Closed ofriedrich closed 4 years ago

ofriedrich commented 5 years ago

If the caching is enabled, the following line overwrites the $fs with a new Filesystem-object but without any configuration.

https://github.com/barryvdh/elfinder-flysystem-driver/blob/ed6d22765d56dfc2807b8a2af0b4c004066d7b2c/src/Driver.php#L150

                if ($this->fscache) {
                    $adapter = new CachedAdapter($adapter, $this->fscache);
                    $this->fs = new Filesystem($adapter);
                }

If the configuration contains any parameters, that are important e. g. to set the visibility of files in an S3 bucket, this configuration is not available anymore.

Maybe it is a good idea to add the configuration here:

                    $this->fs = new Filesystem($adapter, $this->fs->getConfig());