From fc3ebb8c6563b832b6a090dbd0e89aadb7121ef3 Mon Sep 17 00:00:00 2001 From: Erik Trapman Date: Wed, 13 Jun 2012 16:31:03 +0200 Subject: [PATCH] [FileSystem] added if-windows check --- src/Symfony/Component/Filesystem/Filesystem.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php index ed032ed39b..d5ffaf6bf1 100644 --- a/src/Symfony/Component/Filesystem/Filesystem.php +++ b/src/Symfony/Component/Filesystem/Filesystem.php @@ -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); + } } } }