From 5dccc705639a1cb2725116331e062cb0f0ca3fca Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 12 Jun 2025 16:50:04 +0200 Subject: [PATCH] #7567 @1.5 --- src/CommandLine/LocalToGCSRclone.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/CommandLine/LocalToGCSRclone.php b/src/CommandLine/LocalToGCSRclone.php index d4521b3..018c12b 100644 --- a/src/CommandLine/LocalToGCSRclone.php +++ b/src/CommandLine/LocalToGCSRclone.php @@ -3,6 +3,7 @@ namespace Cubist\Util\CommandLine; use Cubist\Net\Transfer\IServer; +use Cubist\Util\CommandLine; use Cubist\Util\Files\Files; class LocalToGCSRclone extends CloneProgram @@ -31,6 +32,7 @@ class LocalToGCSRclone extends CloneProgram $this->setManualArg($dest); } + public function setServer(IServer $server) { parent::setServer($server); @@ -75,4 +77,20 @@ class LocalToGCSRclone extends CloneProgram { return true; } + + public function execute($fonction = 'shell_exec') + { + parent::execute($fonction); + + $ls = new CommandLine('rclone'); + $ls->setArg(null, 'lsl'); + $tmp = Files::tempnam(); + file_put_contents($tmp, $this->getGCSServiceAccountKey()); + $ls->setArg('gcs-service-account-file', $tmp); + $ls->setArg('gcs-bucket-policy-only'); + $dest = ':gcs:' . $this->getBucket() . '/' . rtrim($this->getDest(), '/') . '/'; + $ls->setManualArg($dest); + $ls->execute(); + $ls->debug(); + } } \ No newline at end of file -- 2.39.5