Skip to content

Conversation

@david-garcia-garcia
Copy link

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #...
License MIT
Doc PR symfony/symfony-docs#...

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()

@nicolas-grekas
Copy link
Member

See #18324 for some background on the topic.

$ok = @symlink($originDir, $targetDir);
}

if (!$ok && strncasecmp(PHP_OS, 'WIN', 3) == 0) {
Copy link
Member

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 the PHP_OS constant as follows: 'Darwin' === PHP_OS But for Windows, we always use this indirect detection: '\\' === DIRECTORY_SEPARATOR

@fabpot
Copy link
Member

fabpot commented Mar 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.

@fabpot fabpot closed this Mar 22, 2017
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