File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/Symfony/Component/Finder/Iterator Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,18 @@ public function rewind()
39
39
while ($ iterator instanceof \OuterIterator) {
40
40
$ innerIterator = $ iterator ->getInnerIterator ();
41
41
42
- if ($ innerIterator instanceof \FilesystemIterator) {
42
+ if ($ innerIterator instanceof RecursiveDirectoryIterator) {
43
+ // this condition is necessary for iterators to work properly with non-local filesystems like ftp
44
+ if ($ innerIterator ->isRewindable ()) {
45
+ $ innerIterator ->next ();
46
+ $ innerIterator ->rewind ();
47
+ }
48
+ } elseif ($ innerIterator instanceof \FilesystemIterator) {
43
49
$ innerIterator ->next ();
44
50
$ innerIterator ->rewind ();
45
51
}
46
- $ iterator = $ iterator ->getInnerIterator ();
52
+
53
+ $ iterator = $ innerIterator ;
47
54
}
48
55
49
56
parent ::rewind ();
You can’t perform that action at this time.
0 commit comments