Skip to content

Instantly share code, notes, and snippets.

@Mouerr
Created January 15, 2020 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mouerr/6edfacf34a4738ce8d61fd4708f5fd47 to your computer and use it in GitHub Desktop.
Save Mouerr/6edfacf34a4738ce8d61fd4708f5fd47 to your computer and use it in GitHub Desktop.
private static function recurseCopy($src, $dst)
{
$dir = opendir($src);
@mkdir($dst, 0777, true);
while (false !== ($file = readdir($dir))) {
if (($file !== '.') && ($file !== '..')) {
if (is_dir($src.'/'.$file)) {
self::recurseCopy($src.'/'.$file, $dst.'/'.$file);
} else {
copy($src.'/'.$file, $dst.'/'.$file);
}
}
}
closedir($dir);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment