From 6ececb66a824fca707831aa170e975b52f75e624 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 5 Nov 2024 19:53:41 +0100 Subject: [PATCH] wip #7175 --- src/Transfer/S3.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Transfer/S3.php b/src/Transfer/S3.php index 4573928..ed76ea7 100644 --- a/src/Transfer/S3.php +++ b/src/Transfer/S3.php @@ -3,6 +3,7 @@ namespace Cubist\Net\Transfer; use Aws\S3\S3Client; +use Cubist\Util\CommandLine\LocalToS3Rclone; use Cubist\Util\CommandLine\Rclone; class S3 extends Driver @@ -14,7 +15,7 @@ class S3 extends Driver /** * @return S3Client */ - protected function createClient($data) + protected function createClient(&$data) { return new S3Client($this->_getClientConfig($data)); } @@ -22,11 +23,11 @@ class S3 extends Driver public function checkConnexion($data = []) { + $client = $this->createClient($data); + $test = 'test' . time() . '-' . rand(1, 1000000); $testFile = trim($data['base_path'], '/') . '/' . $test . '.txt'; - $client = $this->createClient($data); - $oc = ['Bucket' => $data['bucket'], 'Key' => $testFile]; try { @@ -74,7 +75,8 @@ class S3 extends Driver protected function synchronizeFiles($source, $dest, $mirror = false, $dryrun = false) { - $rclone = new Rclone(); + $rclone = new LocalToS3Rclone(); + $rclone->setServer($this->getServer()); $rclone->setArg(); $rclone->setSrc($source); $rclone->setDest(rtrim($this->getServer()->getBasePath(), '/') . '/' . trim($dest, '/') . '/'); -- 2.39.5