Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Filesystem::joinPaths() #33375

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
wants to merge 1 commit into from

Conversation

tomasfejfar
Copy link
Contributor

@tomasfejfar tomasfejfar commented Aug 28, 2019

Q A
Branch? 4.4 for features
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #26523
License MIT
Doc PR symfony/symfony-docs#12803

@tomasfejfar
Copy link
Contributor Author

@javiereguiluz let me know what you think. If it makes sense like this, I'll add docs PR... I also thought about adding another "normalization" function that can normalize separators in any string (c:\test/appc:/test/app). That might we useful when one needs to work with paths using string functions for one reason or other... , but I think it's fine to add it in separate PR later.

@nicolas-grekas nicolas-grekas added this to the next milestone Aug 30, 2019
Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would love to get this merged

@@ -24,6 +24,27 @@ class Filesystem
{
private static $lastError;

public static function joinPaths(string ...$pathSegments): string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A description including an example would be helpful

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the docs I've just created help? symfony/symfony-docs#12803

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing but the method itself should have a description in the phpdoc too

@nicolas-grekas
Copy link
Member

I've had a look at existing logic into the wild for similar functions, and I think the currently proposed one is too simplistic: eg golang resolves .. and . references.
There is also PR #30969 with proposed to merge "webmozart/path-util" into the component, which would provide a more advanced implementation of the join() function.
I'm therefore closing, thank you for proposing.

@tomasfejfar tomasfejfar deleted the tf-filesystem-join branch February 7, 2020 13:31
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.1 May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants