Closed barryvdh closed 2 years ago
Hi @jnoordsij! I would love to help with PR's for this update, but I'm unable to find any bugs 😅
I'm using;
flysystem
v3flysystem-cached-adapter
elfinder-flysystem-driver
feat-v3
branchlaravel-elfinder
master
branchI tested all elfinder features and everything worked as expected.
How did you got that error on _subdirs
method?
Thanks 🙌
Update on my previous message
I was able to test the Flysystem Driver, and as @jnoordsij said nothing gets listed on ElFinder.
I'm able to create files and folders but it doesn't get in the view.
I found it very strange because apparently the issue is not in the Driver, the json response of the connector is apparently correct.
It includes the list with all files and folders, I compared this response with an older version of this and I couldn't find any difference.
To setup the Flysystem Driver I used this:
use League\Flysystem\Filesystem;
use League\Flysystem\Local\LocalFilesystemAdapter;
[
'driver' => 'Flysystem',
'alias' => 'Uploads',
'filesystem' => new Filesystem(new LocalFilesystemAdapter(public_path('uploads'))),
'cache' => false,
],
Note that League\Flysystem
now uses LocalFilesystemAdapter
instead of LocalAdapter
.
It also has a prefixer by default, so the best approach I got was to setup the path directly in the filesystem
.
Hi @barryvdh!
I have a question for you regarding this issues, I found out that by not using elfinder-flysystem-driver
, elFinder works with local files, if the developer sets nothing on roots
, laravel-elfinder
works just great;
My first question is; what's the usage of elfinder-flysystem-driver
?
And then; if laravel-elfinder
works just great without elfinder-flysystem-driver
, shouldn't the installation be optional?
Yes for local you don't need the flysystem driver. I'll make that optional.
I merged this as 0.4 for now (dev version) and created https://github.com/barryvdh/laravel-elfinder/tree/develop which support 9.x, which you can test with composer require barryvdh/laravel-elfinder:dev-develop --prefer-source
Follow-up on https://github.com/barryvdh/elfinder-flysystem-driver/pull/84 I've tested it on the local driver, not yet ftp/s3. But should be the same logic als all specific adapter code/plugins are removed.
Thanks for looking into this! So far no immediate errors yet, but it's not quite working yet either for me:
_subdirs
method is throwing exceptions on call, because the return type oflistContents
is nowDirectoryListing
instead of array, so thearray_filter
call fails. Replacing https://github.com/barryvdh/elfinder-flysystem-driver/blob/4c6ff7a50c558616bd36bf715e3e85dc6ee28707/src/Driver.php#L289 with$contents = $this->fs->listContents($path)->toArray();
seems to fix this. (Maybe static analysis can find more of these kind of problems?)I'm afraid I won't be able to look into it much further over the next 1-2 weeks, but maybe after that I'll have some spare time to try and help with testing and bugfixing.