]> _ Git - cubist_util.git/commitdiff
wait #6344 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 4 Oct 2023 14:55:43 +0000 (16:55 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 4 Oct 2023 14:55:56 +0000 (16:55 +0200)
src/Files/Files.php

index f88255045cee2dc5a7afd60e30c755d7b08d5259..b3900a54287df17a8f3e7ce1dfab146ffeb7de3d 100644 (file)
@@ -437,4 +437,15 @@ class Files
             unlink($lockFile);
         }
     }
+
+    public static function mirrorDir($from, $to, $mirror = false)
+    {
+        if (!file_exists($from) || !is_dir($from)) {
+            return;
+        }
+        $to = self::mkdir($to);
+        $from = self::mkdir($from);
+        $rsync = new CommandLine\Rsync($from, $to, $mirror);
+        $rsync->execute();
+    }
 }
\ No newline at end of file