Skip to content

Normalize paths to run on windows#280

Open
srsbiz wants to merge 2 commits intodoctrine:0.5.xfrom
srsbiz:path-normalize
Open

Normalize paths to run on windows#280
srsbiz wants to merge 2 commits intodoctrine:0.5.xfrom
srsbiz:path-normalize

Conversation

@srsbiz
Copy link

@srsbiz srsbiz commented Jan 31, 2024

On windows all paths returned by build-in functions or SplFile object methods contain \ as directory separator. This breaks many things, like calculating relative directory for file being parsed, to include other files.

This can be easily fixed by using Symfony\Component\Filesystem\Path::normalize on any path that may be used to compare against other strings.

Windows path starts with partition letter followed by colon, so there is potential BC break in FileIncluder.php, where colon was used as path separator for $includeRoot argument. This feature to pass multiple roots was undocumented and there were no tests for it, so I hope this change will not have much impact.

@Oviglo
Copy link

Oviglo commented Mar 24, 2025

Are there any news about this PR ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants