From cae7516c3a082886d62a5ffbc8b54bba2bb84298 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 4 Oct 2023 16:55:43 +0200 Subject: [PATCH] wait #6344 @0.5 --- src/Files/Files.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Files/Files.php b/src/Files/Files.php index f882550..b3900a5 100644 --- a/src/Files/Files.php +++ b/src/Files/Files.php @@ -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 -- 2.39.5