]> _ Git - cubist_net.git/commitdiff
#7567
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 26 May 2025 18:08:27 +0000 (20:08 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 26 May 2025 18:08:27 +0000 (20:08 +0200)
composer.json
src/Transfer/GCS.php [new file with mode: 0644]
src/Transfer/S3.php

index 590a5b135b695b11ba6cbde31977fab1a173e06d..9367717bdb6ff5bb3220b964181ca9d94135b884 100644 (file)
@@ -26,7 +26,8 @@
     "ext-ssh2": "*",
     "cubist/util": "dev-master",
     "ext-ftp": "*",
-    "aws/aws-sdk-php": "^3.325"
+    "aws/aws-sdk-php": "^3.325",
+    "google/cloud-storage": "*"
   },
   "suggest": {
 
diff --git a/src/Transfer/GCS.php b/src/Transfer/GCS.php
new file mode 100644 (file)
index 0000000..14e390a
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+
+namespace Cubist\Net;
+
+use Cubist\Net\Transfer\Driver;
+use Cubist\Util\CommandLine\LocalToS3Rclone;
+
+class GCS extends Driver
+{
+
+    public function checkConnexion($data = [])
+    {
+        // TODO: Implement checkConnexion() method.
+    }
+
+    protected function synchronizeFiles($source, $dest, $mirror = false, $dryrun = false)
+    {
+        $rclone = new LocalToGCSRclone();
+        $rclone->setServer($this->getServer());
+        $rclone->setArg();
+        $rclone->setSrc($source);
+        $rclone->setDest(rtrim($this->getServer()->getBasePath(), '/') . '/' . trim($dest, '/') . '/');
+        $rclone->setMirror($mirror);
+        $rclone->setDryRun($dryrun);
+        $rclone->execute();
+        return $rclone;
+    }
+}
index ce8ba57d721fb394ba54dc84a58bb388533db260..5f9707273c8f2c4f996c4802a090eac2ae713000 100644 (file)
@@ -4,7 +4,6 @@ namespace Cubist\Net\Transfer;
 
 use Aws\S3\S3Client;
 use Cubist\Util\CommandLine\LocalToS3Rclone;
-use Cubist\Util\CommandLine\Rclone;
 
 class S3 extends Driver
 {