Alright, I've addressed the issue you pointed out! #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix: Populate d_type for shadow directory streams
Problem:
You were right, the shadow PHP extension wasn't correctly setting the
d_type(directory entry type) when creating merged directory streams. This could cause tools likeRecursiveDirectoryIteratorto be less efficient and potentially behave unexpectedly.Solution:
I've made a couple of adjustments:
d_typeof each entry.d_typefrom the instance entry is stored or updated.d_typefor each entry.This should ensure that
RecursiveDirectoryIteratorand other directory handling functions can work efficiently and correctly by having access to thed_type.I've also added a new test case (
tests/iterator_test.phpt) and the necessary supporting files to specifically cover this scenario.Testing Limitations:
I encountered some difficulties trying to build the extension and run the tests in my current environment. I kept running into a sandbox error related to calculating file changes after certain commands, particularly those needing
sudoaccess (like installing the PHP extension). I tried a few different approaches to work around this, but unfortunately, I couldn't get past this environmental limitation.You've asked me to publish the branch so you can test it in your CI environment, and I'm happy to do that.