$filesCreatedWhileMirroring =
[];
foreach ($iterator as $file) { if ($file->
getPathname() ===
$targetDir ||
$file->
getRealPath() ===
$targetDir ||
isset($filesCreatedWhileMirroring[$file->
getRealPath()])) { continue;
} $target =
$targetDir.
substr($file->
getPathname(),
$originDirLen);
$filesCreatedWhileMirroring[$target] = true;
if (!
$copyOnWindows &&
is_link($file)) { $this->
symlink($file->
getLinkTarget(),
$target);
} elseif (is_dir($file)) { $this->
mkdir($target);
} elseif (is_file($file)) { $this->
copy($file,
$target,
$options['override'
] ?? false
);
} else { throw new IOException(sprintf('Unable to guess "%s" file type.',
$file), 0, null,
$file);
} } } /**
* Returns whether the file path is an absolute path.
*/