-
Notifications
You must be signed in to change notification settings - Fork 356
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
Fix for the isDir function in the FTP Adapter #607
base: master
Are you sure you want to change the base?
Conversation
…xception. Also move the URL creation to a private method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a private method for the connection URL.
I also kept the chdir method as the main approach and fallback on is_dir with passive mode set to true if we catch and exception with chdir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update ;)
@nicolasmure I pushed a fix with your comments applied in it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also squash your commits please ? :)
@nicolasmure Got it. Pushed a change accordingly to your comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes :)
There are also some failing tests, do you mind to fix them ?
phpunit :
There were 2 failures:
1) Gaufrette\Functional\Adapter\FtpTest::shouldCheckIfFileExists
Failed asserting that true is false.
/home/travis/build/KnpLabs/Gaufrette/tests/Gaufrette/Functional/Adapter/FunctionalTestCase.php:91
2) Gaufrette\Functional\Adapter\FtpTest::shouldFailWhenTryMtimeForKeyWhichDoesNotExist
Failed asserting that 1561017417 is false.
/home/travis/build/KnpLabs/Gaufrette/tests/Gaufrette/Functional/Adapter/FunctionalTestCase.php:119
and also the phpspec for this adapter.
You can run the specs with
$ docker/run-task php7.2 vendor/bin/phpspec run spec/Gaufrette/Adapter/Ftp.php
and the integration tests with
$ docker/run-task php7.2 vendor/bin/phpunit tests/Gaufrette/Functional/Adapter/FtpTest.php
Your comments have been integrated. These are nice improvements. ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also update the tests accordingly please ?
@nicolasmure I'm not sure how to update the tests since they're not checking the way we connect to the server. |
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:
Changing the way we perform this test by using the PHP function
is_dir
instead of theftp_chdir
one fixes this error.