MagentoHackathon\Composer\Magento\Plugin::copyRecursive PHP Метод

copyRecursive() защищенный Метод

Some systems can't rename and also don't have proc_open, which requires this solution. copied from \Composer\Util\Filesystem::copyThenRemove and removed the remove part
protected copyRecursive ( string $source, string $target )
$source string
$target string
    protected function copyRecursive($source, $target)
    {
        $it = new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS);
        $ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::SELF_FIRST);
        $this->filesystem->ensureDirectoryExists($target);
        foreach ($ri as $file) {
            $targetPath = $target . DIRECTORY_SEPARATOR . $ri->getSubPathName();
            if ($file->isDir()) {
                $this->filesystem->ensureDirectoryExists($targetPath);
            } else {
                copy($file->getPathname(), $targetPath);
            }
        }
    }