namespace Cubist\Net\Transfer;
use Aws\S3\S3Client;
+use Cubist\Util\CommandLine\Rclone;
class S3 extends Driver
{
return new S3Client($this->_getClientConfig($data));
}
+
public function checkConnexion($data = [])
{
$test = 'test' . time() . '-' . rand(1, 1000000);
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;
}
}
+++ /dev/null
-<?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;
-
- }
-}