Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fc3ebb8

Browse files
author
Erik Trapman
committed
[FileSystem] added if-windows check
1 parent 0b58828 commit fc3ebb8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,15 @@ public function remove($files)
9494

9595
if (is_dir($file) && !is_link($file)) {
9696
$this->remove(new \FilesystemIterator($file));
97-
rmdir($file);
98-
} elseif(is_dir($file) && is_link($file)) {
99-
// https://bugs.php.net/bug.php?id=52176 windows thinks symlinks are directories
97+
10098
rmdir($file);
10199
} else {
102-
unlink($file);
100+
// https://bugs.php.net/bug.php?id=52176
101+
if (defined('PHP_WINDOWS_VERSION_MAJOR') && is_dir($file)) {
102+
rmdir($file);
103+
} else {
104+
unlink($file);
105+
}
103106
}
104107
}
105108
}

0 commit comments

Comments
 (0)