From: Vincent Vanwaelscappel Date: Wed, 4 Oct 2023 14:55:43 +0000 (+0200) Subject: wait #6344 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=cae7516c3a082886d62a5ffbc8b54bba2bb84298;p=cubist_util.git wait #6344 @0.5 --- 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