Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. function recurse_copy($src,$dst) {
  2. $dir = opendir($src);
  3. @mkdir($dst);
  4. while(false !== ( $file = readdir($dir)) ) {
  5. if (( $file != '.' ) && ( $file != '..' ) && ( $file != 'Obj' )) {
  6. if ( is_dir($src . '/' . $file) ) {
  7. recurse_copy($src . '/' . $file,$dst . '/' . $file);
  8. }
  9. else {
  10. if($file != 'compile.php'){
  11. if(file_exists($dst . '/' . $file))
  12. {
  13. if(filemtime($src . '/' . $file) > filemtime($dst . '/' . $file))
  14. {
  15. copy($src . '/' . $file,$dst . '/' . $file);
  16. }
  17. }
  18. else
  19. {
  20. copy($src . '/' . $file,$dst . '/' . $file);
  21. }
  22. }
  23. }
  24. }
  25. }
  26. closedir($dir);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement