Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Fix symlinks on Windows.#21887
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Fix symlinks on Windows.#21887
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedMar 6, 2017
See#18324 for some background on the topic. |
| $ok = @symlink($originDir,$targetDir); | ||
| } | ||
| if (!$ok &&strncasecmp(PHP_OS,'WIN',3) ==0) { |
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.
Minor comment: to detect if the OS is macOS, we use thePHP_OS constant as follows:'Darwin' === PHP_OS But for Windows, we always use this indirect detection:'\\' === DIRECTORY_SEPARATOR
fabpot commentedMar 22, 2017
Closing as it cannot be merged as is. Feel free to reopen if you think you can finish it by taking#18324 into consideration. Thanks. |
Php's symlink function on Windows is completely broken, see:
php/php-src#1243
https://bugs.php.net/bug.php?id=69473
Looks like there is little to no intention to fix this in core. An alternative way to achieve symlinks (properly) on Windows is to use the command line.
I submitted a similar PR for the composer/composer project, where they use symfony's filesystem + a manual junction based fallback for windows:
composer/composer#6213
This patch adds additional fallback to try and create the symlink on windows environments using exec()