Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Introducing `\WP_CLI\Utils\normalize_path` function. Using it for ABSPATH constant. #4718
I didn't modify any other functions (like e.g.
I think it's great that we now have this normalization function, since everyone can now use it for cross-platform (in other words, Windows-friendly) path operations.
If you could copy the core test also, to
That's fine, will be done in another PR.
I've addressed all of your feedback above, please review!
I've also added a unit test for the new function, where I copied all of the WP Core test cases plus added a couple of new ones (like empty-string test and root-only test).
Yes, I agree, no need to worry about it for now, but in general I like the idea of having a wrapper for paths - if done well, that would alleviate quite a bit of potential path-related headache :)