Gaufrette
Gaufrette copied to clipboard
Fix for the isDir function in the FTP Adapter
The isDir function seems to be broken in the FTP Adapter.
When I try to retrieve a document through a stream, I get this error: ftp_chdir(): /documents/your-file-name.jpg: No such file or directory
Here is the complete trace:
in vendor/knplabs/gaufrette/src/Gaufrette/StreamWrapper.php->stat (line 210)
in vendor/knplabs/gaufrette/src/Gaufrette/Stream/InMemoryBuffer.php->isDirectory (line 159)
in vendor/knplabs/gaufrette/src/Gaufrette/Filesystem.php->isDirectory (line 333)
in vendor/knplabs/gaufrette/src/Gaufrette/Adapter/Ftp.php->isDir (line 222)
in vendor/knplabs/gaufrette/src/Gaufrette/Adapter/Ftp.phpftp_chdir (line 369)
in vendor/knplabs/gaufrette/src/Gaufrette/Adapter/Ftp.php (line 369)
Changing the way we perform this test by using the PHP function is_dir
instead of the ftp_chdir
one fixes this error.
@nicolasmure I pushed a fix with your comments applied in it.
@nicolasmure Got it. Pushed a change accordingly to your comment.
Your comments have been integrated. These are nice improvements. ;)
@nicolasmure I'm not sure how to update the tests since they're not checking the way we connect to the server.