Ensure backend slashes for symlinks on Windows systems

Resolves: #17614
This commit is contained in:
Nicole Cordes 2016-01-30 18:41:36 +01:00 committed by Nicolas Grekas
parent 36cb46a71a
commit d897956362

View File

@ -301,10 +301,15 @@ class Filesystem
*/ */
public function symlink($originDir, $targetDir, $copyOnWindows = false) public function symlink($originDir, $targetDir, $copyOnWindows = false)
{ {
if ($copyOnWindows && !function_exists('symlink')) { if ('\\' === DIRECTORY_SEPARATOR) {
$this->mirror($originDir, $targetDir); $originDir = strtr($originDir, '/', '\\');
$targetDir = strtr($targetDir, '/', '\\');
return; if ($copyOnWindows) {
$this->mirror($originDir, $targetDir);
return;
}
} }
$this->mkdir(dirname($targetDir)); $this->mkdir(dirname($targetDir));