namespace Cubist\Net\Transfer;
use Aws\S3\S3Client;
+use Cubist\Util\CommandLine\LocalToS3Rclone;
use Cubist\Util\CommandLine\Rclone;
class S3 extends Driver
/**
* @return S3Client
*/
- protected function createClient($data)
+ protected function createClient(&$data)
{
return new S3Client($this->_getClientConfig($data));
}
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 {
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, '/') . '/');