Browse Source

merged branch jonathaningram/patch-1 (PR #2466)

Commits
-------

6343bef [HttpKernel] Updated mirror method to check for symlinks before dirs and files

Discussion
----------

[HttpKernel] Updated mirror method to check for symlinks before dirs and files

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2436
Fabien Potencier 13 years ago
parent
commit
68eb068fd8
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/Symfony/Component/HttpKernel/Util/Filesystem.php

+ 3 - 3
src/Symfony/Component/HttpKernel/Util/Filesystem.php

@@ -204,12 +204,12 @@ class Filesystem
         foreach ($iterator as $file) {
             $target = $targetDir.'/'.str_replace($originDir.DIRECTORY_SEPARATOR, '', $file->getPathname());
 
-            if (is_dir($file)) {
+            if (is_link($file)) {
+                $this->symlink($file, $target);
+            } else if (is_dir($file)) {
                 $this->mkdir($target);
             } else if (is_file($file) || ($copyOnWindows && is_link($file))) {
                 $this->copy($file, $target, isset($options['override']) ? $options['override'] : false);
-            } else if (is_link($file)) {
-                $this->symlink($file, $target);
             } else {
                 throw new \RuntimeException(sprintf('Unable to guess "%s" file type.', $file));
             }