]> _ Git - cubist_net.git/commitdiff
wip #7175 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 5 Nov 2024 16:46:31 +0000 (17:46 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 5 Nov 2024 16:46:31 +0000 (17:46 +0100)
src/Transfer/S3.php
src/Transfer/S3Compatible.php [deleted file]

index d6a7d530906f940520941b051bf4d06b2fa83a66..4195c94f20b90c569ef656901c39040408862a10 100644 (file)
@@ -3,6 +3,7 @@
 namespace Cubist\Net\Transfer;
 
 use Aws\S3\S3Client;
+use Cubist\Util\CommandLine\Rclone;
 
 class S3 extends Driver
 {
@@ -18,6 +19,7 @@ class S3 extends Driver
         return new S3Client($this->_getClientConfig($data));
     }
 
+
     public function checkConnexion($data = [])
     {
         $test = 'test' . time() . '-' . rand(1, 1000000);
@@ -65,5 +67,13 @@ class S3 extends Driver
     protected function synchronizeFiles($source, $dest, $mirror = false, $dryrun = false)
     {
 
+        $rclone = new Rclone();
+       $rclone->setArg();
+        $rclone->setSrc($source);
+        $rclone->setDest(rtrim($this->getServer()->getBasePath(), '/') . '/' . trim($dest, '/') . '/');
+        $rclone->setMirror($mirror);
+        $rclone->setDryRun($dryrun);
+        $rclone->execute();
+        return $rclone;
     }
 }
diff --git a/src/Transfer/S3Compatible.php b/src/Transfer/S3Compatible.php
deleted file mode 100644 (file)
index f41e585..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-
-namespace Cubist\Net\Transfer;
-
-class S3Compatible extends S3
-{
-
-    protected function _getClientConfig(&$data)
-    {
-        $res = parent::_getClientConfig($data);
-        $res['use_path_style_endpoint'] = true;
-        $res['endpoint'] = $data['endpoint'];
-
-        return $res;
-
-    }
-}