You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for reporting! The regression has been introduced by commit f323baa, where the change to RecursiveDirectoryIterator::hasChildren() apparently is not prepared to handle kind of hard-linked directories. I'll have a closer look.
Junctions are not symlinks; they are more like hardlinks, but still different. If you want to create symlinked folders on Windows, use mklink /d. If the folders were symlinked, your script worked as intended; on junctions are broken as of PHP 8.1.0.
cmb69
changed the title
RecursiveDirectoryIterator with RecursiveIteratorIterator does not include symlinked folders on windows in PHP 8.1
RecursiveDirectoryIterator regression wrt. junctions
Oct 18, 2022
cmb69
added a commit
to cmb69/php-src
that referenced
this issue
Oct 18, 2022
If we `lstat()` a junction on Windows, it is not `S_ISLNK()`, but we
still must not assume that it is not a link (in the broadest sense).
In lack of a proper way to detect that, we use the fact that `.st_mode`
is zero in this case.
Hi. This bug has been causing me some headaches recently because composer only uses junctions on Windows for path based repositories and I have a third party CMS that uses RecursiveDirectoryIterator to scan those directories (without success).
Not sure if this is usual for PHP, but the above fix was added a year ago and nothing has happened since.
Is that fix likely to make it through soon?
Description
When loading files in $path using
PHP 8.1 on Windows (Windows 10) does not include files located in a folder that is a symlink (junction).
The unread folder is on the same disk and its symlink (junction) is inserted into $path.
If I view $directory using
I can see the symlinked folders. But if I try to load the files using
the files located in the symlinked folder are no longer dumped. The files in the actual folders in $path are included.
In PHP 8.0 and below, everything is fine and the above code works.
Sorry for my English.
PHP Version
PHP 8.1.11
Operating System
Windows 10
The text was updated successfully, but these errors were encountered: