Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in function _stat(), $stat['name'] is never set - remnants from older flysystem api? #95

Open
dekeonus opened this issue Mar 22, 2024 · 0 comments

Comments

@dekeonus
Copy link

in _stat() meta['filename'] is never set and $meta['extension'] is set to null (both in the check for existence in attributeCache and when constructing meta from the this->fs object).

// Set item filename.extension to `name` if exists
if (isset($meta['filename']) && isset($meta['extension'])) {
$stat['name'] = $meta['filename'];
if ($meta['extension'] !== '') {
$stat['name'] .= '.' . $meta['extension'];
}
}

Background: I was looking for a quick "temporary" fix for webdav where most of my client software set "Content-Type:" to application/octet-stream or didn't set it at all and that is the webdav server's default.
So I was intending to use the flysystem mime-type-detection package to override the anything returned as application/octet-stream

On the note of older code the import (use) block at the beginning of the file seems to have some invalid (for flysystem^3) entries:

use League\Flysystem\Cached\CachedAdapter;
use League\Flysystem\Cached\CacheInterface;

my understanding is that flysystem-cached-adapter is flysystem-1.x only

and

use League\Flysystem\Util;

went away in flysystem-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant