-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Directory separator and its duplicates #103
Directory separator and its duplicates #103
Conversation
Previous inheritence required PSR-4 to override anyway.
And rename variables for better understandinf
The integration tests are creating a temptestdir which is deleted after each test is run, but when they fail remains.
I just realised the tests will fail for the same reason we needed DIRECTORY_SEPARATOR! |
Source of `$workingDir` is `getcwd()`. Automated tests pass on MacOS. Manual test passes on Windows: coenjacobs#90 (comment)
…OR-and-its-duplicates
This looks good with master merged into it and tested on MacOS and on Windows 10 w/ PHP 7.4. It was on a pretty fresh VM on Parallels so needed:
Interestingly, "DIRECTORY_SEPARATOR is not necessarily needed, PHP always converts / to the appropriate character in its file functions." To run the tests, I needed.
It's failing with PHP 8 in GitHub Actions. |
…OR-and-its-duplicates
Fix for #90 , #43.
The meat in this is
trim(preg_replace('/[\/\\\\]+/', DIRECTORY_SEPARATOR, $path), DIRECTORY_SEPARATOR)
which is run on every variable inMover::moveFile()
that is to be used in a file path. The provides Windows <-> Unix compatibility and by always trimming the slashes, makes it easier to reason inside the code.$workingDir
is the only variable with a leading slash, since it is the absolute path and all others are relative.No tests written, but existing tests are fine.Marking it as draft for a few weeks while I test it in production!Two integration tests added.