symfony/symfony — Issue #2436: [HttpKernel] [Filesystem::mirror] symlinked directory contents are not copied
Author: jonathaningram
Created: 2011-10-20 06:36:59+00:00
State: open

I believe this is a bug. Basically, the code is as follows:

if (is_dir($file)) {
$this->mkdir($target);
} else if (is_file($file)) {
$this->copy($file, $target, $options);
} else if (is_link($file)) {
$this->symlink($file, $target);
} else {
throw new \RuntimeException(sprintf('Unable to guess "%s" file type.', $file));
}

Because it checks for `is_dir` first, if a directory is a symbolic link, it will get its dir made, but not its contents.

It should check for `is_link` first, no?