[FileSystem] added if-windows check

This commit is contained in:
Erik Trapman 2012-06-13 16:31:03 +02:00
parent 0b58828b3f
commit fc3ebb8c65

View File

@ -94,12 +94,15 @@ class Filesystem
if (is_dir($file) && !is_link($file)) {
$this->remove(new \FilesystemIterator($file));
rmdir($file);
} elseif(is_dir($file) && is_link($file)) {
// https://bugs.php.net/bug.php?id=52176 windows thinks symlinks are directories
rmdir($file);
} else {
unlink($file);
// https://bugs.php.net/bug.php?id=52176
if (defined('PHP_WINDOWS_VERSION_MAJOR') && is_dir($file)) {
rmdir($file);
} else {
unlink($file);
}
}
}
}