-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
RecursiveDirectoryFtpIterator #4354
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
Conversation
{ | ||
if ($this->isDir()) { | ||
return $this->getPath(); | ||
} else { |
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.
no need to use else
as the if
returns
How does this PR relate to #4335 ? |
@vicb 4335 is a solution to a general problem with filters. I think that in their current state they can not be used to filter user created iterators. Probably inside filter's accept method we should call Inside
The filter is The item is The filter filters iterator Methods:
are called from Not from our own item The solution is to add:
I think it is a general, not necessarily ftp-related, problem. I found it indispensable during my work on |
Could this be solved by using a |
In case of
Thus maybe constructor's parameter should be I thought about it. But it breaks tests: there are 42 errors. I wasn't sure about it and left it as it is. |
\RecursiveIteratorIterator::SELF_FIRST | ||
); | ||
if (Iterator\RecursiveDirectoryFtpIterator::isValidFtpUrl($dir)) { | ||
|
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.
extra empty line to be removed
Is is intended that all methods of |
@vicb I don't know where to put I think we need universal ftp class. Maybe as a new component? Current state of implementation consists of three classes:
I will use |
I don't think we need a new component for this Ftp class. It would be overkill IMO. |
@stof Thanks for your suggestion. I will create |
@vicb You are right: I should use Next change was to use as much of |
I'm not we want to support FTP in the Finder. The ticket was about fixing the failure for non-rewindable streams (FTP being just an example). |
@fabpot Sorry for this mess. My solution consists of ftp iterator and solves only the problems with ftp stream. If you consider it inadequate - sorry. |
@fabpot What do you think about minimal ftp implementation (in |
Who is still using FTP nowadays? Note that this is not an ironical question but a real one. I stopped using FTP many many years ago, and I wonder if this is still a protocol widely used. |
I agree with you. But how can we solve |
I don't know who uses it inside their apps. But FTP is still pretty much the only option to upload the files if your website is on shared hosting. |
@mvrhov Thats exactly the reason I've tried to correct |
Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass:
Fixes the following tickets: #3585
Todo: This is only the first step to get some feedback
License of the code: MIT