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)
{
if ($copyOnWindows && !function_exists('symlink')) {
$this->mirror($originDir, $targetDir);
if ('\\' === DIRECTORY_SEPARATOR) {
$originDir = strtr($originDir, '/', '\\');
$targetDir = strtr($targetDir, '/', '\\');
return;
if ($copyOnWindows) {
$this->mirror($originDir, $targetDir);
return;
}
}
$this->mkdir(dirname($targetDir));