-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Filesystem] Fixed makePathRelative #22321
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
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
fc745f4
Remove unnecessary if construct
ausi 3a29c1d
Do not strip the beginning of relative paths, only drive letters
ausi 15982d4
Normalize ./ path segments
ausi 9586e88
Do not strip ../ segments from the beginning of relative paths
ausi cec473e
Fix parameter description
ausi 1b795d7
Fixed compatibility with PHP 5.3
ausi fea3bb0
Fixed coding style
ausi 28b29ee
Fixed compatibility with PHP 5.3
ausi 193cdf8
Revert "Fix parameter description"
ausi bce33c4
Don’t use substr()
ausi 23b4a56
Coding style
ausi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
This is not something that is supported. The docblock states that the paths have to be absolute.
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.
There was already an existing unit test (FilesystemTest.php:1097) that tested relative paths.
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.
Let's not add new ones. Tests should respect the contract which is to pass an absolute path.
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.
@chalasr the function always supported relative paths (before 3.2.7). There are even pre-existing test cases for that.
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.
@chalasr Should I remove the pre-existing relative path tests then too? Or should I just remove the relative path tests that I added?
E7EE 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.
Can you please provide a new link to this test? Previous one is outdated and I can't find it
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.
Yes, it’s line 1102 in the current master branch:
symfony/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
Line 1102 in 8088661
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.
Indeed, it should be removed (we did revert a similar test for the very same reason #22133 (comment)). It's safe to do it here I think.
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.
Done in a2a1d0d
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.
@chalasr Actually, the example that you gave was a test I mistakenly added in that very same PR. So it was never part of a merge. :)