flysystem-dropbox
                                
                                 flysystem-dropbox copied to clipboard
                                
                                    flysystem-dropbox copied to clipboard
                            
                            
                            
                        fix listContents() for subdirectories if parent is uppercase
Let's say we have file Foo/bar/baz.txt on dropbox. Then
$adapter = new DropboxAdapter(…);
$filesystem = new Filesystem($adapter);
$filesystem->listContents('Foo/bar');
returns an empty array.
The problem is that the dropbox API returns the path as lowercase: foo/bar. League\Flysystem::listContents() then filters the content out because it compares 'Foo/bar' to 'foo/bar'.
@basz I think this is related.
Shouldn't the entire path be lowercased? What reason is there to only lowercase everything from the first parent directory?
I don't have my 'finger behind it' completely yet. I am having troubles with a unix and osx environment which handles cases differently.
But I think that the mapper callback in https://github.com/thephpleague/flysystem/blob/master/src/Filesystem.php#L355 should be aware of the case sensitivity of the adapter.
I have an dropbox app in which I get mixed results for a prefixed path and a path without the prefix set. Confusing...
From what I've seen so far the last part of the path (basename) is always case sensitive. Everything else esp. on longer paths gets lowercased. So when querying down the path tree preserving the then basename part in every step should hopefully result in a complete case preserved path.
But I think that the mapper callback in https://github.com/thephpleague/flysystem/blob/master/src/Filesystem.php#L355 should be aware of the case sensitivity of the adapter.
:+1:
I'm having the same problem at spatie/flysystem-dropbox too. If somebody knows a good solution for this problem, I'd highly appreciate a clean well-tested fix for this problem.