Permalink
Browse files

[FileSystem] added if-windows check

  • Loading branch information...
1 parent e1a5395 commit 31abac1cc37bb2482595f7b0af4bb69f236dc978 Erik Trapman committed Jun 13, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 Filesystem.php
View
@@ -94,12 +94,15 @@ public function remove($files)
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);
+ }
}
}
}

0 comments on commit 31abac1

Please sign in to comment.